📄 codegraph.cs
字号:
}
#endregion
#region FieldDecl
/// <summary>
/// A field declaration.
/// </summary>
public class FieldDecl : MemberDecl // isn't IDeclaration - declarators are
{
/// <exclude/>
public override GraphTypes GraphType{get{return GraphTypes.FieldDecl;}}
public override MemberKind MemberKind{get{return MemberKind.Field;}}
#region Delcarators
private DeclaratorCollection p_declarators = new DeclaratorCollection();
/// <summary>
/// Gets the collection of declarators created in the field. Fields can declare multiple variables at once, so this must be a collection.
/// </summary>
[CodeCollection]
public DeclaratorCollection Delcarators
{
get
{
return p_declarators;
}
}
#endregion
#region Type
private TypeRef p_type;
/// <summary>
/// Gets or sets the type of the field declaration. While a field can declare multiple variables, they must be of the same type, so this is not a collection.
/// </summary>
[CodeElement]
public TypeRef Type
{
get
{
return p_type;
}
set
{
p_type = value;
}
}
#endregion
#region Text
/// <exclude/>
public override string Text
{
get
{
string s = this.GetType().Name;
s = s.Substring(0, s.LastIndexOf("Decl"));
return s;;
}
}
#endregion
}
#endregion
#region PropertyDecl -d
/// <summary>
/// A property declaration.
/// </summary>
public class PropertyDecl : MemberDecl, IDeclaration
{
/// <exclude/>
public override GraphTypes GraphType{get{return GraphTypes.PropertyDecl;}}
public override MemberKind MemberKind{get{return MemberKind.Property;}}
#region Name
/// <summary>
/// Gets or sets the name of the property. This may use dot syntax.
/// </summary>
[CodeElement]
public string Name
{
get
{
return p_definition.Name;
}
set
{
p_definition.Name = value;
}
}
#endregion
#region GetAccessor
private AccessorDecl p_getAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'get' accessor for this property. This will not have an associated block if the property is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl GetAccessor
{
get
{
return p_getAccessor;
}
set
{
p_getAccessor = value;
}
}
#endregion
#region SetAccessor
private AccessorDecl p_setAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'set' accessor for this property, if present. This will not have an associated block if the property is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl SetAccessor
{
get
{
return p_setAccessor;
}
set
{
p_setAccessor = value;
}
}
#endregion
#region Type
private TypeRef p_type;
/// <summary>
/// Gets or sets the type of the property.
/// </summary>
[CodeElement]
public TypeRef Type
{
get
{
return p_type;
}
set
{
p_type = value;
}
}
#endregion
#region HasGet
private bool p_hasGet = false;
/// <summary>
/// Gets or sets the boolean value that indicates whether a get accessor is to be used.
/// </summary>
[CodeElement]
public bool HasGet
{
get
{
return p_hasGet;
}
set
{
p_hasGet = value;
}
}
#endregion
#region HasSet
private bool p_hasSet = false;
/// <summary>
/// Gets or sets the boolean value that indicates whether a set accessor is to be used. Setting this to false will not destroy the SetAccessor value.
/// </summary>
[CodeElement]
public bool HasSet
{
get
{
return p_hasSet;
}
set
{
p_hasSet = value;
}
}
#endregion
#region Definition
private IDefinition p_definition = new Definition();
/// <summary>
/// Gets the (scoped) definition.
/// </summary>
public IDefinition Definition
{
get
{
return p_definition;
}
}
#endregion
#region Text
/// <exclude/>
public override string Text
{
get
{
string s = this.GetType().Name;
s = s.Substring(0, s.LastIndexOf("Decl"));
s += " - ";
if(Definition == null) s += this.Name;
else s += Definition.ToString();
return s; //+ ": " + Name;
}
}
#endregion
}
#endregion
#region EventDecl
/// <summary>
/// An event declaration.
/// </summary>
public class EventDecl : MemberDecl
{
/// <exclude/>
public override GraphTypes GraphType{get{return GraphTypes.EventDecl;}}
public override MemberKind MemberKind{get{return MemberKind.Event;}}
#region Type
private TypeRef p_type;
/// <summary>
/// Gets or sets the type of the event. This must be a delegate type.
/// </summary>
[CodeElement]
public TypeRef Type
{
get
{
return p_type;
}
set
{
p_type = value;
}
}
#endregion
#region Delcarators
private DeclaratorCollection p_declarators = new DeclaratorCollection();
/// <summary>
/// Gets a declarator collection. Events can declare multiple variables (like fields) if no accessors are present, so this must be a collection. If accessors are present, the name will be stored in the first declarator, however in this case it may have an interface name prepended - thus it may be in dot syntax. The declarator expression is always ignored.
/// </summary>
[CodeCollection]
public DeclaratorCollection Delcarators
{
get
{
return p_declarators;
}
}
#endregion
#region AddAccessor
private AccessorDecl p_addAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'add' accessor for this property, if present. It is an error to have an add accessor without a remove accessor. This will not have an associated block if the property is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl AddAccessor
{
get
{
return p_addAccessor;
}
set
{
p_addAccessor = value;
}
}
#endregion
#region RemoveAccessor
private AccessorDecl p_removeAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'remove' accessor for this property, if present. It is an error to have an add accessor without a remove accessor. This will not have an associated block if the property is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl RemoveAccessor
{
get
{
return p_removeAccessor;
}
set
{
p_removeAccessor = value;
}
}
#endregion
#region UsesAccessors
private bool p_usesAccessors = false;
/// <summary>
/// Gets or sets the boolean value that indicates whether accessors are to be used. Setting this to false will not destroy the accessor values.
/// </summary>
[CodeElement]
public bool UsesAccessors
{
get
{
return p_usesAccessors;
}
set
{
p_usesAccessors = value;
}
}
#endregion
#region Text
/// <exclude/>
public override string Text
{
get
{
string s = this.GetType().Name;
s = s.Substring(0, s.LastIndexOf("Decl"));
if(Delcarators.Count > 0)
foreach(Declarator d in Delcarators)
s += " - " + d.Name;
return s; //+ ": " + Name;
}
}
#endregion
}
#endregion
#region ConstantDecl
/// <summary>
/// A constant declartation.
/// </summary>
public class ConstantDecl : MemberDecl
{
/// <exclude/>
public override GraphTypes GraphType{get{return GraphTypes.ConstantDecl;}}
public override MemberKind MemberKind{get{return MemberKind.Constant;}}
#region Delcarators
private DeclaratorCollection p_declarators = new DeclaratorCollection();
/// <summary>
/// Gets the collection of declarators created in the field. Constants declarations can declare multiple variables at once, so this must be a collection.
/// </summary>
[CodeCollection]
public DeclaratorCollection Delcarators
{
get
{
return p_declarators;
}
}
#endregion
#region Type
private TypeRef p_type;
/// <summary>
/// Gets or sets the type of the constant. There can only be one type per declaration.
/// </summary>
[CodeElement]
public TypeRef Type
{
get
{
return p_type;
}
set
{
p_type = value;
}
}
#endregion
#region Text
/// <exclude/>
public override string Text
{
get
{
string s = this.GetType().Name;
s = s.Substring(0, s.LastIndexOf("Decl"));
return s; //+ ": " + Name;
}
}
#endregion
}
#endregion
#region IndexerDecl -ds
/// <summary>
/// An indexer declartation.
/// </summary>
public class IndexerDecl : MemberDecl, IDeclaration, IScope, IOverloadable
{
/// <exclude/>
public override GraphTypes GraphType{get{return GraphTypes.IndexerDecl;}}
public override MemberKind MemberKind{get{return MemberKind.Indexer;}}
#region Parameters
private ParamDeclCollection p_parameters = new ParamDeclCollection();
/// <summary>
/// Gets the collection of parameters for the indexer. Each of these hold information about the type, direction etc.
/// </summary>
[CodeCollection]
public ParamDeclCollection Parameters
{
get
{
return p_parameters;
}
}
#endregion
#region GetAccessor
private AccessorDecl p_getAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'get' accessor for the indexer. This will not have an associated block if the indexer is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl GetAccessor
{
get
{
return p_getAccessor;
}
set
{
p_getAccessor = value;
}
}
#endregion
#region SetAccessor
private AccessorDecl p_setAccessor = new AccessorDecl();
/// <summary>
/// Gets or sets the 'set' accessor for the indexer. This will not have an associated block if the indexer is declared as abstract or in an interface.
/// </summary>
[CodeElement]
public AccessorDecl SetAccessor
{
get
{
return p_setAccessor;
}
set
{
p_setAccessor = value;
}
}
#endregion
#region Type
private TypeRef p_type;
/// <summary>
/// Gets or sets the type of the indexer.
/// </summary>
[CodeElement]
public TypeRef Type
{
get
{
return p_type;
}
set
{
p_type = value;
}
}
#endregion
#region InterfaceType
private TypeRef p_itype;
/// <summary>
/// Gets or sets the interface type, if present. In the case of a class implementing multiple interfaces that require indexers, the interface type is prepended to 'this' (with the syntax IList.this).
/// </summary>
[CodeElement]
public TypeRef InterfaceType
{
get
{
return p_itype;
}
set
{
p_itype = value;
}
}
#endregion
#region HasGet
private bool p_hasGet = false;
/// <summary>
/// Gets or sets the boolean value that indicates whether a get accessor is to be used. Setting this to false will not destroy the GetAccessor value.
/// </summary>
[CodeElement]
public bool HasGet
{
get
{
return p_hasGet;
}
set
{
p_hasGet = value;
}
}
#endregion
#region HasSet
private bool p_hasSet = false;
/// <summary>
/// Gets or sets the boolean value that indicates whether a set accessor is to be used. Setting this to false will not destroy the SetAccessor value.
/// </summary>
[CodeElement]
public bool HasSet
{
get
{
return p_hasSet;
}
set
{
p_hasSet = value;
}
}
#endregion
#region Definition
private IDefinition p_definition = new OverloadableDefinition();
/// <summary>
/// Gets the (scoped) definition.
/// </summary>
public IDefinition Definition
{
get
{
return p_definition;
}
}
#endregion
#region Scope
private Scope p_scope;
public Scope Scope
{
get
{
return p_scope;
}
set
{
p_scope = value;
}
}
#endregion
#region Name
/// <summary>
/// Gets the name of the indexer (which is always 'Item').
/// </summary>
public string Name
{
get
{
return "Item";
}
set
{
}
}
#endregion
#region HashText
/// <exclude/>
/// <summary>
/// Gets the hash string of this defintion. This is of the form Name@Out:param1@Ref:param2...
/// </summary>
public string HashText
{
get
{
string s = this.Name;
foreach(ParamDecl pd in Parameters)
{
s += "@" + pd.Direction.ToString();
s += ":" + pd.Type.TypeName;
}
return s;
}
}
#endregion
}
#endregion
#region OperatorDecl -s
/// <summary>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -