1 //------------------------------------------------------------------------------
2 // <copyright file="CodeTypeMember.cs" company="Microsoft">
4 // <OWNER>[....]</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Reflection;
16 using System.Runtime.InteropServices;
17 using System.Runtime.Serialization;
21 /// Represents a class member.
25 ClassInterface(ClassInterfaceType.AutoDispatch),
29 public class CodeTypeMember : CodeObject {
30 private MemberAttributes attributes = MemberAttributes.Private | MemberAttributes.Final;
32 private CodeCommentStatementCollection comments = new CodeCommentStatementCollection();
33 private CodeAttributeDeclarationCollection customAttributes = null;
34 private CodeLinePragma linePragma;
36 // Optionally Serializable
38 private CodeDirectiveCollection startDirectives = null;
40 private CodeDirectiveCollection endDirectives = null;
46 /// the name of the member.
51 return (name == null) ? string.Empty : name;
60 /// Gets or sets a <see cref='System.CodeDom.MemberAttributes'/> indicating
61 /// the attributes of the member.
64 public MemberAttributes Attributes {
75 /// Gets or sets a <see cref='System.CodeDom.CodeAttributeDeclarationCollection'/> indicating
76 /// the custom attributes of the
80 public CodeAttributeDeclarationCollection CustomAttributes {
82 if (customAttributes == null) {
83 customAttributes = new CodeAttributeDeclarationCollection();
85 return customAttributes;
88 customAttributes = value;
94 /// The line the statement occurs on.
97 public CodeLinePragma LinePragma {
108 /// Gets or sets the member comment collection members.
111 public CodeCommentStatementCollection Comments {
117 public CodeDirectiveCollection StartDirectives {
119 if (startDirectives == null) {
120 startDirectives = new CodeDirectiveCollection();
122 return startDirectives;
126 public CodeDirectiveCollection EndDirectives {
128 if (endDirectives == null) {
129 endDirectives = new CodeDirectiveCollection();
131 return endDirectives ;