C# Class FlatRedBall.Glue.CodeGeneration.EventCodeGenerator

Inheritance: ElementComponentCodeGenerator
Exibir arquivo Open project: vchelaru/FlatRedBall Class Usage Examples

Public Methods

Method Description
AddStubsForCustomEvents ( IElement element ) : void
AddUsingStatementsToBlock ( ICodeBlock currentBlock ) : void
CreateEmptyCodeIfNecessary ( IElement currentElement, string fullFileName, bool forceRegenerateContents ) : void
FillWithCustomEventCode ( ICodeBlock currentBlock, EventResponseSave ers, string contents, IElement element ) : ICodeBlock
FillWithGeneratedEventCode ( ICodeBlock currentBlock, EventResponseSave ers, IElement element ) : ICodeBlock
GenerateActivity ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
GenerateDestroy ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
GenerateEventGeneratedFile ( IElement element ) : void
GenerateFields ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
GenerateInitialize ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
GeneratePostInitialize ( ICodeBlock codeBlock, IElement element ) : void
GetStartAndEndIndexForMethod ( ParsedMethod parsedMethod, string fileContents, int &startIndex, int &endIndex ) : void

Returns the start and end index in the argument fileContents of the entire method including the header of the method and the opening/closing brackets.

GetStartAndEndIndexForMethod ( string fileContents, string name, int &startIndex, int &endIndex ) : void
InjectTextForEventAndSaveCustomFile ( IElement currentElement, EventResponseSave eventResponseSave, string insideOfMethod ) : string

Injects the insideOfMethod into an event for the argument

ShouldGenerateEventsForVariable ( CustomVariable customVariable, IElement container ) : bool

Private Methods

Method Description
GenerateAddToManagersBottomUp ( ICodeBlock codeBlock, IElement element ) : void
GenerateEventGeneratedCodeFile ( IElement element ) : ICodeBlock
GenerateEventRaisingCode ( ICodeBlock codeBlock, BeforeOrAfter beforeOrAfter, string variableName, IElement saveObject ) : void
GenerateEventsForVariable ( ICodeBlock codeBlock, string variableName, bool isEventNew = false ) : void
GenerateInitializeForEvent ( ICodeBlock codeBlock, IElement element, EventResponseSave ers ) : void
GetParsedClassFrom ( string fileName ) : ParsedClass
StripTypesFromArguments ( string argumentsWithTypes ) : string
TryGenerateEventsForVariable ( ICodeBlock codeBlock, CustomVariable customVariable, IElement container ) : void

Method Details

AddStubsForCustomEvents() public static method

public static AddStubsForCustomEvents ( IElement element ) : void
element IElement
return void

AddUsingStatementsToBlock() public static method

public static AddUsingStatementsToBlock ( ICodeBlock currentBlock ) : void
currentBlock ICodeBlock
return void

CreateEmptyCodeIfNecessary() public static method

public static CreateEmptyCodeIfNecessary ( IElement currentElement, string fullFileName, bool forceRegenerateContents ) : void
currentElement IElement
fullFileName string
forceRegenerateContents bool
return void

FillWithCustomEventCode() public static method

public static FillWithCustomEventCode ( ICodeBlock currentBlock, EventResponseSave ers, string contents, IElement element ) : ICodeBlock
currentBlock ICodeBlock
ers FlatRedBall.Glue.Events.EventResponseSave
contents string
element IElement
return ICodeBlock

FillWithGeneratedEventCode() public static method

public static FillWithGeneratedEventCode ( ICodeBlock currentBlock, EventResponseSave ers, IElement element ) : ICodeBlock
currentBlock ICodeBlock
ers FlatRedBall.Glue.Events.EventResponseSave
element IElement
return ICodeBlock

GenerateActivity() public method

public GenerateActivity ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
codeBlock ICodeBlock
element IElement
return ICodeBlock

GenerateDestroy() public method

public GenerateDestroy ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
codeBlock ICodeBlock
element IElement
return ICodeBlock

GenerateEventGeneratedFile() public static method

public static GenerateEventGeneratedFile ( IElement element ) : void
element IElement
return void

GenerateFields() public method

public GenerateFields ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
codeBlock ICodeBlock
element IElement
return ICodeBlock

GenerateInitialize() public method

public GenerateInitialize ( ICodeBlock codeBlock, IElement element ) : ICodeBlock
codeBlock ICodeBlock
element IElement
return ICodeBlock

GeneratePostInitialize() public static method

public static GeneratePostInitialize ( ICodeBlock codeBlock, IElement element ) : void
codeBlock ICodeBlock
element IElement
return void

GetStartAndEndIndexForMethod() public static method

Returns the start and end index in the argument fileContents of the entire method including the header of the method and the opening/closing brackets.
public static GetStartAndEndIndexForMethod ( ParsedMethod parsedMethod, string fileContents, int &startIndex, int &endIndex ) : void
parsedMethod FlatRedBall.Glue.Parsing.ParsedMethod The parsed method.
fileContents string The contents of the entire file.
startIndex int The found startIndex.
endIndex int The found endIndex which includes the closing bracket.
return void

GetStartAndEndIndexForMethod() public static method

public static GetStartAndEndIndexForMethod ( string fileContents, string name, int &startIndex, int &endIndex ) : void
fileContents string
name string
startIndex int
endIndex int
return void

InjectTextForEventAndSaveCustomFile() public static method

Injects the insideOfMethod into an event for the argument
public static InjectTextForEventAndSaveCustomFile ( IElement currentElement, EventResponseSave eventResponseSave, string insideOfMethod ) : string
currentElement IElement The IElement containing the EventResponseSave.
eventResponseSave FlatRedBall.Glue.Events.EventResponseSave The EventResponseSave which should have its contents set or replaced.
insideOfMethod string The inside of the methods to assign.
return string

ShouldGenerateEventsForVariable() public static method

public static ShouldGenerateEventsForVariable ( CustomVariable customVariable, IElement container ) : bool
customVariable FlatRedBall.Glue.SaveClasses.CustomVariable
container IElement
return bool