mscorlib(4.0.0.0) API with additions
CodeNamespace.cs
3 
4 namespace System.CodeDom
5 {
8  [ClassInterface(ClassInterfaceType.AutoDispatch)]
9  [ComVisible(true)]
10  public class CodeNamespace : CodeObject
11  {
12  private string name;
13 
15 
17 
19 
20  private CodeNamespaceCollection namespaces = new CodeNamespaceCollection();
21 
22  private int populated;
23 
24  private const int ImportsCollection = 1;
25 
26  private const int CommentsCollection = 2;
27 
28  private const int TypesCollection = 4;
29 
33  {
34  get
35  {
36  if ((populated & 4) == 0)
37  {
38  populated |= 4;
39  if (this.PopulateTypes != null)
40  {
41  this.PopulateTypes(this, EventArgs.Empty);
42  }
43  }
44  return classes;
45  }
46  }
47 
51  {
52  get
53  {
54  if ((populated & 1) == 0)
55  {
56  populated |= 1;
57  if (this.PopulateImports != null)
58  {
59  this.PopulateImports(this, EventArgs.Empty);
60  }
61  }
62  return imports;
63  }
64  }
65 
68  public string Name
69  {
70  get
71  {
72  if (name != null)
73  {
74  return name;
75  }
76  return string.Empty;
77  }
78  set
79  {
80  name = value;
81  }
82  }
83 
87  {
88  get
89  {
90  if ((populated & 2) == 0)
91  {
92  populated |= 2;
93  if (this.PopulateComments != null)
94  {
95  this.PopulateComments(this, EventArgs.Empty);
96  }
97  }
98  return comments;
99  }
100  }
101 
104 
107 
110 
112  public CodeNamespace()
113  {
114  }
115 
118  public CodeNamespace(string name)
119  {
120  Name = name;
121  }
122 
123  private CodeNamespace(SerializationInfo info, StreamingContext context)
124  {
125  }
126  }
127 }
CodeNamespace()
Initializes a new instance of the T:System.CodeDom.CodeNamespace class.
Definition: __Canon.cs:3
CodeCommentStatementCollection Comments
Gets the comments for the namespace.
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition: EventArgs.cs:9
Describes the source and destination of a given serialized stream, and provides an additional caller-...
static readonly EventArgs Empty
Provides a value to use with events that do not have event data.
Definition: EventArgs.cs:13
EventHandler PopulateImports
An event that will be raised the first time the P:System.CodeDom.CodeNamespace.Imports collection is ...
Represents a collection of T:System.CodeDom.CodeCommentStatement objects.
delegate void EventHandler(object sender, EventArgs e)
Represents the method that will handle an event that has no event data.
Represents a collection of T:System.CodeDom.CodeNamespaceImport objects.
EventHandler PopulateTypes
An event that will be raised the first time the P:System.CodeDom.CodeNamespace.Types collection is ac...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Represents a namespace declaration.
EventHandler PopulateComments
An event that will be raised the first time the P:System.CodeDom.CodeNamespace.Comments collection is...
Represents a collection of T:System.CodeDom.CodeNamespace objects.
CodeNamespace(string name)
Initializes a new instance of the T:System.CodeDom.CodeNamespace class using the specified name.
Specifies that the class can be serialized.
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
string Name
Gets or sets the name of the namespace.
CodeNamespaceImportCollection Imports
Gets the collection of namespace import directives used by the namespace.
Provides a common base class for most Code Document Object Model (CodeDOM) objects.
Definition: CodeObject.cs:11
CodeTypeDeclarationCollection Types
Gets the collection of types that the namespace contains.
Represents a collection of T:System.CodeDom.CodeTypeDeclaration objects.