The CodeTemplate type exposes the following members.

Constructors

  NameDescription
Public methodCodeTemplate
Initializes a new instance of the CodeTemplate class

Methods

  NameDescription
Protected methodControlAdded (Inherited from Control.)
Protected methodControlRemoved (Inherited from Control.)
Public methodCopyPropertiesTo(CodeTemplate)
Copies any matching properties to another CodeTemplate instance.
Public methodCopyPropertiesTo(CodeTemplate, Boolean)
Copies any matching properties to another CodeTemplate instance.
Public methodCopyPropertiesTo(CodeTemplate, ICollection<(Of <<'(String>)>>))
Copies any matching properties to another CodeTemplate instance.
Public methodCopyPropertiesTo(CodeTemplate, Boolean, ICollection<(Of <<'(String>)>>))
Copies any matching properties to another CodeTemplate instance.
Public methodCreate<(Of <<'(T>)>>)()()()()
Gets an instance of the specified template type. Should be used with the Register directive.
Public methodCreate<(Of <<'(T>)>>)(Boolean)
Gets an instance of the specified template type. Should be used with the Register directive.
Protected methodCreateChildControls (Inherited from Control.)
Protected methodCreateControlCollection (Inherited from Control.)
Public methodDispose()()()()
Releases all resources used by the CodeTemplate
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the CodeTemplate and optionally releases the managed resources
Protected methodEnsureChildControls (Inherited from Control.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Overrides Object..::..Finalize()()()().)
Public methodGetCodeTemplateInstance(String)
Gets an instance of the specified template.
Public methodGetCodeTemplateInstance(String, Boolean)
Gets an instance of the specified template.
Public methodGetCodeTemplateInstance(String, Boolean, Boolean)
Gets an instance of the specified template.
Public methodGetCustomValidationErrors
Allows the developer to add custom ValidationErrors to the validation collection.
Public methodGetFileName
Gets a default name for the template output. This can be overridden in your template to provide a suitable name for the output of the template based on the property values.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetProperties()()()()
Gets information on all of the properties on this template.
Public methodGetProperties(Boolean)
Gets information on all of the properties on this template.
Public methodGetProperty
Gets the value for the specified property.
Public methodGetPropertyAttribute
Gets the property attribute. Property attributes can be used to store various information at the property level.
Public methodGetPropertyDescription
Public methodGetPropertyInfo
Public methodGetRequiredProperties
Gets information on all of the required properties for this template.
Public methodGetTemplateAttribute
Gets the template attribute. Template attributes can be used to store various information at the template level.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHasControls (Inherited from Control.)
Public methodIsPropertyRequired
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnError
This method can be overridden to perform logic when a template exception occurs.
Protected methodOnInit
This method can be overridden to perform logic when the template instance is created.
Protected methodOnOutputRegistered
This is the method that is responsible for notifying receivers that the event occurred
Protected methodOnPostRender
This method can be overridden to perform logic after the template is rendered.
Protected methodOnPreOutputWritten(String)
This is the method that is responsible for notifying receivers that the event occurred
Protected methodOnPreOutputWritten(OutputCancelEventArgs)
This is the method that is responsible for notifying receivers that the event occurred
Protected methodOnPreRender
This method can be overridden to perform logic before the template is rendered.
Protected methodOnPropertiesLoaded
This method can be overridden to perform logic when properties are loaded.
Protected methodOnPropertiesSaved
This method can be overridden to perform logic when properties are saved.
Protected methodOnPropertyChanged
This method can be overridden to perform logic when a property changes.
Protected methodOnReferenceRegistered
Raises the ItemRegisteredEventArgs event.
Public methodParseDefaultValue
Parses the default value for properties. This can be overridden to provide custom default parsing logic.
Public methodRefreshProperties()()()()
Public methodRefreshProperties(Boolean)
Public methodRegisterOutput(String)
Public methodRegisterOutput(OutputFile)
Public methodRegisterReference
Registers the reference. When generating from within Visual Studio, these references will be added to the project.
Public methodRender
Renders to the template output to the specified writer.
(Overrides Control..::..Render(TextWriter).)
Protected methodRenderChildren (Inherited from Control.)
Public methodRenderToFile(String, IMergeStrategy)
Renders the template output to a file using a merge strategy.
Public methodRenderToFile(String, Boolean)
Renders the template output to a file.
Public methodRenderToFile(OutputFile, Boolean)
Renders the template output to a file.
Public methodRenderToFile(String, String, IMergeStrategy)
Renders the template output to a file using a merge strategy.
Public methodRenderToFile(String, String, Boolean)
Renders the template output to a file.
Public methodRenderToFile(OutputFile, String, IMergeStrategy)
Renders the template output to a file using a merge strategy.
Public methodRenderToString()()()()
Renders the template output to a String.
Public methodRenderToString(String, IMergeStrategy)
Renders the template output to a String.
Public methodRestorePropertiesFromHashtable
Restores the properties from a Hashtable.
Public methodRestorePropertiesFromPropertySet
Public methodRestorePropertiesFromSchema
Public methodRestorePropertiesFromXml
Restores the properties from XML.
Public methodRestorePropertiesFromXmlFile
Restores the properties from XML file.
Public methodSavePropertiesToHashtable()()()()
Saves the properties to a Hashtable.
Public methodSavePropertiesToHashtable(Boolean)
Saves the properties to a Hashtable.
Public methodSavePropertiesToPropertySet
Public methodSavePropertiesToXml()()()()
Saves the properties to XML.
Public methodSavePropertiesToXml(XmlWriter)
Saves the properties to XML.
Public methodSavePropertiesToXmlFile
Saves the properties to an XML file.
Protected methodSetContextData
Set the context data object for the template. Any items in the current ContextData object will be added to the new one. This method should only be called while a template is initializing.
Public methodSetProperty(PropertyInfo, Object)
Sets the value for the specified property.
Public methodSetProperty(String, Object)
Sets the value for the specified property.
Public methodSetProperty(XmlNode, String)
Public methodSetPropertyAttribute
Sets the property attribute. Property attributes can be used to store various information at the property level.
Protected methodSetPropertyDefaults
This method is overridden in templates to set default values in a template instance.
Public methodSetTemplateAttribute
Sets the template attribute. Template attributes can be used to store various information at the template level.
Protected methodSetUnknownDirectiveAttributes
This method is overridden in templates to set unknown directive attributes in the ContextData.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates this template instance.

Fields

  NameDescription
Protected field_childControlsCreated (Inherited from Control.)
Protected field_codeTemplate (Inherited from Control.)
Protected field_controls (Inherited from Control.)
Protected field_parent (Inherited from Control.)
Protected field_visible (Inherited from Control.)

Properties

  NameDescription
Protected propertyChildControlsCreated (Inherited from Control.)
Protected propertyCodeTemplate (Inherited from Control.)
Public propertyCodeTemplateInfo
Gets the information for the current template.
Public propertyContextData
Contextual data items can be stored in this object and shared with sub-templates. This data will not be persisted with the template property set.
Protected propertyControls (Inherited from Control.)
Protected propertyParent (Inherited from Control.)
Public propertyProgress
Provides a way to report execution progress for the template.
Public propertyRegisteredOutputs
Public propertyRegisteredReferences
Public propertyResponse
Response stream for the template output. You can write to the stream programmatically using this property.
Public propertyState
State of this template instance.
Public propertyValidationErrors
Gets the validation errors for this template.
Protected propertyVisible (Overrides Control..::..Visible.)

Events

  NameDescription
Public eventOutputRegistered
Raised when an output file is registered
Public eventPreOutputWritten
Raised prior to an output being written to disk
Public eventPropertiesLoaded
Public eventPropertiesSaved
Public eventPropertyChanged
Public eventReferenceRegistered
Occurs when a reference is registered.

See Also