PropertyBuilder Class

Summary

[Editor-Only] Manages the details for building a property in a procedural C# script.
graph BT Type-->Base0["MemberBuilder"] click Base0 "/weaver/api/Weaver.Editor.Procedural.Scripting/MemberBuilder" Base0-->Base1["ElementBuilder"] click Base1 "/weaver/api/Weaver.Editor.Procedural.Scripting/ElementBuilder" Base1-->Base2["Object"] Type["PropertyBuilder"] class Type type-node

Syntax

public class PropertyBuilder : MemberBuilder

Fields

Name Constant Value Summary
DefaultCommentBuilder
The default delegate to use to build the XML comment for this element. Assigned using the return value of Weaver.Editor.Procedural.Scripting.ElementBuilder.GetDefaultCommentBuilder.
Inherited from ElementBuilder
DefaultModifiers
The default access modifiers for this member.
Inherited from MemberBuilder

Properties

Name Value Summary
AttributeConstructorBuilders Action<StringBuilder>[]
The methods used to build the constructor of each custom attribute for this member.
Inherited from MemberBuilder
Attributes Type[]
The custom attribute types for this member.
Inherited from MemberBuilder
CommentBuilder Action<StringBuilder>
This delegate is used to append the XML comment for this element. By default it will simply append the Weaver.Editor.Procedural.Scripting.ElementBuilder.NameSource.
Inherited from ElementBuilder
CompilationSymbolIndex int
The index in Weaver.Editor.Procedural.Scripting.ScriptBuilder.CompilationSymbols of the symbol in which this element will be declared, I.E. #if SYMBOL.
Inherited from ElementBuilder
ExistingMember MemberInfo
The System.Reflection.PropertyInfo of the property with the same type and name as this builder. This property is gathered by Weaver.Editor.Procedural.Scripting.PropertyBuilder.IsExistingMember(System.Reflection.MemberInfo,System.Boolean@).
ExistingProperty PropertyInfo
The System.Reflection.PropertyInfo of the property with the same type and name as this builder. This property is gathered by Weaver.Editor.Procedural.Scripting.PropertyBuilder.IsExistingMember(System.Reflection.MemberInfo,System.Boolean@).
FullName string
Returns the full name of this element, including its Weaver.Editor.Procedural.Scripting.ElementBuilder.Parent (and any types and namespaces it is nested inside).
Inherited from ElementBuilder
GetterBuilder AppendFunction
The delegate used to build this property's getter. If null, this property has no getter.
GetterModifiers AccessModifiers
The access modifiers of this property's getter. Matches those assigned to the property itself by default.
HasExistingMember bool
Returns true if this element is associated with an existing System.Reflection.MemberInfo.
Inherited from MemberBuilder
IsFallbackName bool
Indicates whether the current Weaver.Editor.Procedural.Scripting.ElementBuilder.Name of this element is the primary name derived from the Weaver.Editor.Procedural.Scripting.ElementBuilder.NameSource. A value of false means that there was a name conflict between this element and another, and the Weaver.Editor.Procedural.Scripting.ElementBuilder.Name was re-derived using Weaver.Editor.Procedural.Scripting.ScriptBuilder.GetFallbackMemberName(System.String,System.String).
Inherited from ElementBuilder
MemberType MemberTypes
This is a System.Reflection.MemberTypes.Property.
Modifiers AccessModifiers
The access modifiers of this property. Setting this value applies to both the getter and setter.
Name string
The actual Weaver.Editor.Procedural.Scripting.ElementBuilder.Name of this element. This value is derived from Weaver.Editor.Procedural.Scripting.ElementBuilder.NameSource during Weaver.Editor.Procedural.Scripting.ElementBuilder.PrepareToBuild(System.Boolean,System.Boolean@).
Inherited from ElementBuilder
NameSource string
The source string which will be used to determine the actual Weaver.Editor.Procedural.Scripting.ElementBuilder.Name of this element.
Inherited from ElementBuilder
Namespace string
The name of the Weaver.Editor.Procedural.Scripting.NamespaceBuilder containing this type (or null if there isn't one).
Inherited from ElementBuilder
Parent IElementBuilderGroup
The builder of the type in which this element will be declared.
Inherited from ElementBuilder
PropertyType TypeName
The type of object this property represents. Corresponds to System.Reflection.PropertyInfo.PropertyType.
RegionIndex int
The index in Weaver.Editor.Procedural.Scripting.ScriptBuilder.Regions of the region in which this element will be declared, I.E. #region Region Name.
Inherited from ElementBuilder
ReturnValueEquals Func<Object, bool>
If assigned, this delegate is used by Weaver.Editor.Procedural.Scripting.PropertyBuilder.IsExistingMember(System.Reflection.MemberInfo,System.Boolean@) to check the return value of the existing property's getter. Returning false indicates that the value is wrong and the script should be regenerated.
ScriptBuilder ScriptBuilder
The Weaver.Editor.Procedural.Scripting.ScriptBuilder in which this element is currently being used.
Inherited from ElementBuilder
SetterBuilder AppendFunction
The delegate used to build this property's setter. If null, this property has no setter.
SetterModifiers AccessModifiers
The access modifiers of this property's setter. Matches those assigned to the property itself by default.

Methods

Name Value Summary
AppendDescription(StringBuilder, int) void
Appends a description of this element by calling Weaver.Editor.Procedural.Scripting.ElementBuilder.ToString on it.
Inherited from ElementBuilder
AppendFullName(StringBuilder) void
Appends the full name of this element, including its Weaver.Editor.Procedural.Scripting.ElementBuilder.Parent (and any types and namespaces it is nested inside).
Inherited from ElementBuilder
AppendHeader(StringBuilder, int) void
Appends a C# XML comment using the Weaver.Editor.Procedural.Scripting.ElementBuilder.CommentBuilder followed by any Weaver.Editor.Procedural.Scripting.MemberBuilder.Attributes.
Inherited from MemberBuilder
AppendScript(StringBuilder, int) void
Appends the declaration of this element in C# code to the specified `text`.
DetermineMemberName(ScriptBuilder) void
Uses the specified Weaver.Editor.Procedural.Scripting.ScriptBuilder.GetMemberName(System.String,System.String,System.Boolean@) to determine the Weaver.Editor.Procedural.Scripting.ElementBuilder.Name of this element.
Inherited from ElementBuilder
Get(TypeBuilder, string, TypeName, AppendFunction, AppendFunction) PropertyBuilder
Gets a Weaver.Editor.Procedural.Scripting.PropertyBuilder from the object pool and initializes it.
static
GetDefaultCommentBuilder() Action<StringBuilder>
Returns the default method to use to build XML comments for this element. Called once by the constructor.
Inherited from ElementBuilder
GetDescription() string
Gets a description of this element by calling Weaver.Editor.Procedural.Scripting.ElementBuilder.ToString on it and any sub-members.
Inherited from ElementBuilder
Initialize(IElementBuilderGroup, string) void
Assigns the specified parameters to this element and determines the Weaver.Editor.Procedural.Scripting.ElementBuilder.Name.
Inherited from ElementBuilder
IsExistingMember(MemberInfo, bool) bool
Checks if the Weaver.Editor.Procedural.Scripting.ElementBuilder.Name of this member matches the name of the `existingMember`.

Overrides of this method should check other factors to ensure that the existing member matches this builder (such as field type and access modifiers) and if so, cache the member so it can be returned by Weaver.Editor.Procedural.Scripting.MemberBuilder.ExistingMember.
ReleaseToPool() void
Resets this element and adds it to its object pool to be reused later.
Reset() void
Reset all of the fields and properties of this member to their default values.
SetAttributeConstructorBuilders(Action<StringBuilder>[]) void
Sets the Weaver.Editor.Procedural.Scripting.MemberBuilder.AttributeConstructorBuilders array.
Inherited from MemberBuilder
SetAttributes(Type[]) void
Sets the Weaver.Editor.Procedural.Scripting.MemberBuilder.Attributes array.
Inherited from MemberBuilder
SetName(string) void
Sets the Weaver.Editor.Procedural.Scripting.ElementBuilder.Name and Weaver.Editor.Procedural.Scripting.ElementBuilder.NameSource.
Inherited from ElementBuilder
ToString() string
Returns a summary of this element including its type, Weaver.Editor.Procedural.Scripting.ElementBuilder.NameSource, Weaver.Editor.Procedural.Scripting.ElementBuilder.Name, and Weaver.Editor.Procedural.Scripting.ElementBuilder.FullName.
Inherited from ElementBuilder