C# Класс Microsoft.Samples.VisualStudio.GeneratorSample.BaseCodeGenerator

A managed wrapper for VS's concept of an IVsSingleFileGenerator which is a custom tool invoked at design time which can take any file as an input and provide any file as output.
Наследование: IVsSingleFileGenerator
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
IVsSingleFileGenerator int
IVsSingleFileGenerator int

Защищенные методы

Метод Описание
GenerateCode ( string inputFileContent ) : byte[]

The method that does the actual work of generating code given the input file

GeneratorError ( uint level, string message, uint line, uint column ) : void

Method that will communicate an error via the shell callback mechanism

GeneratorWarning ( uint level, string message, uint line, uint column ) : void

Method that will communicate a warning via the shell callback mechanism

GetDefaultExtension ( ) : string

Gets the default extension for this generator

Приватные методы

Метод Описание
IVsSingleFileGenerator ( string &pbstrDefaultExtension ) : int

Implements the IVsSingleFileGenerator.DefaultExtension method. Returns the extension of the generated file

IVsSingleFileGenerator ( string wszInputFilePath, string bstrInputFileContents, string wszDefaultNamespace, IntPtr rgbOutputFileContents, uint &pcbOutput, IVsGeneratorProgress pGenerateProgress ) : int

Implements the IVsSingleFileGenerator.Generate method. Executes the transformation and returns the newly generated output file, whenever a custom tool is loaded, or the input file is saved

Описание методов

GenerateCode() защищенный абстрактный Метод

The method that does the actual work of generating code given the input file
protected abstract GenerateCode ( string inputFileContent ) : byte[]
inputFileContent string File contents as a string
Результат byte[]

GeneratorError() защищенный Метод

Method that will communicate an error via the shell callback mechanism
protected GeneratorError ( uint level, string message, uint line, uint column ) : void
level uint Level or severity
message string Text displayed to the user
line uint Line number of error
column uint Column number of error
Результат void

GeneratorWarning() защищенный Метод

Method that will communicate a warning via the shell callback mechanism
protected GeneratorWarning ( uint level, string message, uint line, uint column ) : void
level uint Level or severity
message string Text displayed to the user
line uint Line number of warning
column uint Column number of warning
Результат void

GetDefaultExtension() защищенный абстрактный Метод

Gets the default extension for this generator
protected abstract GetDefaultExtension ( ) : string
Результат string