2 // System.CodeDom.Compiler CodeGeneratorOptions class
5 // Daniel Stodden (stodden@in.tum.de)
6 // Sebastien Pouliot <sebastien@ximian.com>
8 // (C) 2002 Ximian, Inc.
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
32 using System.Collections.Specialized;
33 using System.Runtime.InteropServices;
34 using System.Security.Permissions;
36 namespace System.CodeDom.Compiler {
38 [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
39 public class CodeGeneratorOptions {
41 private IDictionary properties;
46 public CodeGeneratorOptions()
48 properties = new ListDictionary();
56 /// Whether to insert blank lines between individual members.
59 public bool BlankLinesBetweenMembers {
61 object o = properties["BlankLinesBetweenMembers"];
62 return ((o == null) ? true : (bool) o);
65 properties["BlankLinesBetweenMembers"] = value;
70 /// "Block" puts braces on the same line as the associated statement or declaration.
71 /// "C" puts braces on the following line.
74 public string BracingStyle {
76 object o = properties["BracingStyle"];
77 return ((o == null) ? "Block" : (string) o);
80 properties["BracingStyle"] = value;
85 /// Whether to start <code>else</code>,
86 /// <code>catch</code>, or <code>finally</code>
87 /// blocks on the same line as the previous block.
90 public bool ElseOnClosing {
92 object o = properties["ElseOnClosing"];
93 return ((o == null) ? false : (bool) o);
96 properties["ElseOnClosing"] = value;
101 /// The string used for individual indentation levels. Default is four spaces.
103 public string IndentString {
105 object o = properties["IndentString"];
106 return ((o == null) ? " " : (string) o);
109 properties["IndentString"] = value;
113 public Object this[string index] {
115 return properties[index];
118 properties[index] = value;
124 public bool VerbatimOrder {
126 object o = properties["VerbatimOrder"];
127 return ((o == null) ? false : (bool) o);
130 properties["VerbatimOrder"] = value;