Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / CompMod / System / CodeDOM / CodeNamespace.cs / 1 / CodeNamespace.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.CodeDom {
using System.Diagnostics;
using System;
using Microsoft.Win32;
using System.Collections;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
///
///
/// Represents a
/// namespace declaration.
///
///
[
ClassInterface(ClassInterfaceType.AutoDispatch),
ComVisible(true),
Serializable,
]
public class CodeNamespace: CodeObject {
private string name;
private CodeNamespaceImportCollection imports = new CodeNamespaceImportCollection();
private CodeCommentStatementCollection comments = new CodeCommentStatementCollection();
private CodeTypeDeclarationCollection classes = new CodeTypeDeclarationCollection();
private CodeNamespaceCollection namespaces = new CodeNamespaceCollection();
private int populated = 0x0;
private const int ImportsCollection = 0x1;
private const int CommentsCollection = 0x2;
private const int TypesCollection = 0x4;
#if CODEDOM_NESTED_NAMESPACES
private const int NamespacesCollection = 0x8;
#endif
///
///
/// An event that will be fired the first time the Comments Collection is accessed.
///
///
public event EventHandler PopulateComments;
///
///
/// An event that will be fired the first time the Imports Collection is accessed.
///
///
public event EventHandler PopulateImports;
#if CODEDOM_NESTED_NAMESPACES
///
///
/// An event that will be fired the first time the Namespaces Collection is accessed.
///
///
public event EventHandler PopulateNamespaces;
#endif
///
///
/// An event that will be fired the first time the Types Collection is accessed.
///
///
public event EventHandler PopulateTypes;
///
///
/// Initializes a new instance of .
///
///
public CodeNamespace() {
}
///
///
/// Initializes a new instance of using the specified name.
///
///
public CodeNamespace(string name) {
Name = name;
}
private CodeNamespace(SerializationInfo info, StreamingContext context) {
}
///
///
/// Gets or sets the collection of classes.
///
///
public CodeTypeDeclarationCollection Types {
get {
if (0 == (populated & TypesCollection)) {
populated |= TypesCollection;
if (PopulateTypes != null) PopulateTypes(this, EventArgs.Empty);
}
return classes;
}
}
///
///
/// Gets or sets the collection of namespace imports used by the represented
/// namespace.
///
///
public CodeNamespaceImportCollection Imports {
get {
if (0 == (populated & ImportsCollection)) {
populated |= ImportsCollection;
if (PopulateImports != null) PopulateImports(this, EventArgs.Empty);
}
return imports;
}
}
///
///
/// Gets or sets the name of the namespace.
///
///
public string Name {
get {
return (name == null) ? string.Empty : name;
}
set {
name = value;
}
}
#if CODEDOM_NESTED_NAMESPACES
///
///
/// Gets or sets the collection of Namespaces.
///
///
public CodeNamespaceCollection Namespaces {
get {
if (0 == (populated & NamespacesCollection)) {
populated |= NamespacesCollection;
if (PopulateNamespaces != null) PopulateNamespaces(this, EventArgs.Empty);
}
return namespaces;
}
}
#endif
///
///
/// Gets or sets the member comment collection members.
///
///
public CodeCommentStatementCollection Comments {
get {
if (0 == (populated & CommentsCollection)) {
populated |= CommentsCollection;
if (PopulateComments != null) PopulateComments(this, EventArgs.Empty);
}
return comments;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.CodeDom {
using System.Diagnostics;
using System;
using Microsoft.Win32;
using System.Collections;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
///
///
/// Represents a
/// namespace declaration.
///
///
[
ClassInterface(ClassInterfaceType.AutoDispatch),
ComVisible(true),
Serializable,
]
public class CodeNamespace: CodeObject {
private string name;
private CodeNamespaceImportCollection imports = new CodeNamespaceImportCollection();
private CodeCommentStatementCollection comments = new CodeCommentStatementCollection();
private CodeTypeDeclarationCollection classes = new CodeTypeDeclarationCollection();
private CodeNamespaceCollection namespaces = new CodeNamespaceCollection();
private int populated = 0x0;
private const int ImportsCollection = 0x1;
private const int CommentsCollection = 0x2;
private const int TypesCollection = 0x4;
#if CODEDOM_NESTED_NAMESPACES
private const int NamespacesCollection = 0x8;
#endif
///
///
/// An event that will be fired the first time the Comments Collection is accessed.
///
///
public event EventHandler PopulateComments;
///
///
/// An event that will be fired the first time the Imports Collection is accessed.
///
///
public event EventHandler PopulateImports;
#if CODEDOM_NESTED_NAMESPACES
///
///
/// An event that will be fired the first time the Namespaces Collection is accessed.
///
///
public event EventHandler PopulateNamespaces;
#endif
///
///
/// An event that will be fired the first time the Types Collection is accessed.
///
///
public event EventHandler PopulateTypes;
///
///
/// Initializes a new instance of .
///
///
public CodeNamespace() {
}
///
///
/// Initializes a new instance of using the specified name.
///
///
public CodeNamespace(string name) {
Name = name;
}
private CodeNamespace(SerializationInfo info, StreamingContext context) {
}
///
///
/// Gets or sets the collection of classes.
///
///
public CodeTypeDeclarationCollection Types {
get {
if (0 == (populated & TypesCollection)) {
populated |= TypesCollection;
if (PopulateTypes != null) PopulateTypes(this, EventArgs.Empty);
}
return classes;
}
}
///
///
/// Gets or sets the collection of namespace imports used by the represented
/// namespace.
///
///
public CodeNamespaceImportCollection Imports {
get {
if (0 == (populated & ImportsCollection)) {
populated |= ImportsCollection;
if (PopulateImports != null) PopulateImports(this, EventArgs.Empty);
}
return imports;
}
}
///
///
/// Gets or sets the name of the namespace.
///
///
public string Name {
get {
return (name == null) ? string.Empty : name;
}
set {
name = value;
}
}
#if CODEDOM_NESTED_NAMESPACES
///
///
/// Gets or sets the collection of Namespaces.
///
///
public CodeNamespaceCollection Namespaces {
get {
if (0 == (populated & NamespacesCollection)) {
populated |= NamespacesCollection;
if (PopulateNamespaces != null) PopulateNamespaces(this, EventArgs.Empty);
}
return namespaces;
}
}
#endif
///
///
/// Gets or sets the member comment collection members.
///
///
public CodeCommentStatementCollection Comments {
get {
if (0 == (populated & CommentsCollection)) {
populated |= CommentsCollection;
if (PopulateComments != null) PopulateComments(this, EventArgs.Empty);
}
return comments;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaSubstitutionGroup.cs
- BinHexEncoder.cs
- EventlogProvider.cs
- DataViewSettingCollection.cs
- MissingSatelliteAssemblyException.cs
- WindowsSolidBrush.cs
- TraceContext.cs
- XPathParser.cs
- AbsoluteQuery.cs
- CodeTypeDeclarationCollection.cs
- LineBreakRecord.cs
- OracleInfoMessageEventArgs.cs
- DBCommand.cs
- LinqExpressionNormalizer.cs
- NamedObject.cs
- OneToOneMappingSerializer.cs
- XPathNode.cs
- EdmItemError.cs
- PropertyValue.cs
- WindowsPrincipal.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- input.cs
- FormParameter.cs
- AspNetSynchronizationContext.cs
- propertyentry.cs
- NameSpaceExtractor.cs
- SessionStateItemCollection.cs
- MouseGestureConverter.cs
- ModuleConfigurationInfo.cs
- PixelFormats.cs
- clipboard.cs
- DefinitionBase.cs
- ColorConverter.cs
- SessionStateItemCollection.cs
- XamlContextStack.cs
- EventlogProvider.cs
- ResXFileRef.cs
- ProgressChangedEventArgs.cs
- precedingquery.cs
- ConstraintStruct.cs
- PersonalizablePropertyEntry.cs
- SuspendDesigner.cs
- WpfPayload.cs
- StreamResourceInfo.cs
- ItemMap.cs
- HuffCodec.cs
- WebGetAttribute.cs
- SuppressMessageAttribute.cs
- DBCommandBuilder.cs
- BrowserInteropHelper.cs
- ReferencedCollectionType.cs
- AuthenticationConfig.cs
- PathSegment.cs
- DeleteIndexBinder.cs
- EntitySetBaseCollection.cs
- DocumentReferenceCollection.cs
- XsltException.cs
- XsdCachingReader.cs
- WorkflowPrinting.cs
- MbpInfo.cs
- TypeKeyValue.cs
- WebPartMenu.cs
- RecognitionEventArgs.cs
- Odbc32.cs
- SplitterDesigner.cs
- RuntimeEnvironment.cs
- Transform3D.cs
- AutomationAttributeInfo.cs
- DesignTimeVisibleAttribute.cs
- XmlImplementation.cs
- AnnotationDocumentPaginator.cs
- TypefaceMetricsCache.cs
- SecurityNegotiationException.cs
- XmlLanguageConverter.cs
- ActivityExecutorDelegateInfo.cs
- PassportIdentity.cs
- LayoutEngine.cs
- XmlIgnoreAttribute.cs
- DesignerDataConnection.cs
- XmlQueryOutput.cs
- ScriptControl.cs
- CharacterMetricsDictionary.cs
- CodeDelegateInvokeExpression.cs
- Sorting.cs
- InputLanguageProfileNotifySink.cs
- SafeRightsManagementSessionHandle.cs
- DataGridColumnHeader.cs
- EdmScalarPropertyAttribute.cs
- DbCommandDefinition.cs
- SelectionPattern.cs
- MessageVersion.cs
- UseLicense.cs
- QueryIntervalOp.cs
- GACMembershipCondition.cs
- Symbol.cs
- DnsPermission.cs
- SerializationSectionGroup.cs
- StatusBar.cs
- SoapEnumAttribute.cs
- Pipe.cs