src/T4Toolbox.VisualStudio/CustomToolParameters.cs
/// <summary>
/// Returns a collection of <see cref="CustomToolParameter"/> objects representing parameters defined in a text template.
/// </summary>
Returns a collection of  objects representing parameters defined in a text template.
Returns a collection of objects representing parameters defined in a text template .
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            this.templatingService = (ITextTemplating)this.serviceProvider.GetService(typeof(STextTemplating));
            this.templatingHost = (ITextTemplatingEngineHost)this.templatingService;
            string templateFileName;
            if (this.ResolveTemplate(out templateFileName))
            {
                string templateContent = File.ReadAllText(templateFileName, EncodingHelper.GetEncoding(templateFileName));
                this.templatingService.PreprocessTemplate(templateFileName, templateContent, null, "TemporaryClass", "T4Toolbox", out this.assemblyReferences);
                for (int i = 0; i < this.assemblyReferences.Length; i++)
                {
                    this.assemblyReferences[i] = this.templatingHost.ResolveAssemblyReference(this.assemblyReferences[i]);
                }
                var parameters = new List<CustomToolParameter>();
                this.ParseParameters(templateContent, parameters);
                return new PropertyDescriptorCollection(parameters.Cast<PropertyDescriptor>().ToArray());                
            }
            return PropertyDescriptorCollection.Empty;
        }
public PropertyDescriptorCollection GetProperties ( Attribute [ ] attributes ) { this . templatingService = ( ITextTemplating ) this . serviceProvider . GetService ( typeof ( STextTemplating ) ) ; this . templatingHost = ( ITextTemplatingEngineHost ) this . templatingService ; string templateFileName ; if ( this . ResolveTemplate ( out templateFileName ) ) { string templateContent = File . ReadAllText ( templateFileName , EncodingHelper . GetEncoding ( templateFileName ) ) ; this . templatingService . PreprocessTemplate ( templateFileName , templateContent , null , " " , " " , out this . assemblyReferences ) ; for ( int i = 0 ; i < this . assemblyReferences . Length ; i ++ ) { this . assemblyReferences [ i ] = this . templatingHost . ResolveAssemblyReference ( this . assemblyReferences [ i ] ) ; } var parameters = new List < CustomToolParameter > ( ) ; this . ParseParameters ( templateContent , parameters ) ; return new PropertyDescriptorCollection ( parameters . Cast < PropertyDescriptor > ( ) . ToArray ( ) ) ; } return PropertyDescriptorCollection . Empty ; }
Returns a collection of  objects representing parameters defined in a text template.
Returns a collection of objects representing parameters defined in a text template .
attributes
Attribute[]