C# Class XSharp.CodeDom.XSharpCodeDomHelper

Show file Open project: X-Sharp/XSharpPublic Class Usage Examples

Private Properties

Property Type Description
DumpExpression void
DumpStatement void
FindDesignerClass System.CodeDom.CodeTypeDeclaration
FindDesignerClass System.CodeDom.CodeTypeDeclaration
MergeCodeCompileUnit System.CodeDom.CodeCompileUnit
MergeCodeCompileUnit System.CodeDom.CodeCompileUnit
Write void
WriteIndent void
WriteLine void
WriteLineIndent void

Public Methods

Method Description
BuildDesignerFileName ( string prgFile ) : string

Return the FileName with .Designer inserted

DumpCodeCompileUnit ( CodeCompileUnit ccu, string FileName, bool append ) : void
FindFirstClass ( CodeCompileUnit ccu ) : CodeTypeDeclaration

Reading the CodeCompileUnit, enumerate all NameSpaces, enumerate All Types, searching for the first Class declaration

FindFirstClass ( CodeCompileUnit ccu, CodeNamespace &namespaceName ) : CodeTypeDeclaration
HasPartialClass ( CodeCompileUnit ccu, CodeNamespace &contextNameSpace, CodeTypeDeclaration &contextClass ) : bool

Reading the CodeCompileUnit, enumerate all NameSpaces, enumerate All Types, searching for the first Partial Class.

Private Methods

Method Description
DumpExpression ( System.CodeDom.CodeExpression e ) : void
DumpStatement ( StreamWriter writer, CodeStatement s ) : void
FindDesignerClass ( CodeCompileUnit ccu ) : CodeTypeDeclaration

Reading the CodeCompileUnit, enumerate all NameSpaces, enumerate All Types, searching for the first Class that contains an InitializeComponent member

FindDesignerClass ( CodeCompileUnit ccu, CodeNamespace &namespaceName ) : CodeTypeDeclaration
MergeCodeCompileUnit ( CodeCompileUnit compileUnit, CodeCompileUnit designerCompileUnit ) : CodeCompileUnit

Merge both CodeCompileUnit. The main type (class) will come from designerCompileUnit

MergeCodeCompileUnit ( CodeCompileUnit mergedCodeCompileUnit, CodeCompileUnit compileUnit, CodeCompileUnit designerCompileUnit ) : CodeCompileUnit
Write ( string str ) : void
WriteIndent ( string str ) : void
WriteLine ( string str ) : void
WriteLineIndent ( string str ) : void

Method Details

BuildDesignerFileName() public static method

Return the FileName with .Designer inserted
public static BuildDesignerFileName ( string prgFile ) : string
prgFile string
return string

DumpCodeCompileUnit() static public method

static public DumpCodeCompileUnit ( CodeCompileUnit ccu, string FileName, bool append ) : void
ccu System.CodeDom.CodeCompileUnit
FileName string
append bool
return void

FindFirstClass() public static method

Reading the CodeCompileUnit, enumerate all NameSpaces, enumerate All Types, searching for the first Class declaration
public static FindFirstClass ( CodeCompileUnit ccu ) : CodeTypeDeclaration
ccu System.CodeDom.CodeCompileUnit
return System.CodeDom.CodeTypeDeclaration

FindFirstClass() public static method

public static FindFirstClass ( CodeCompileUnit ccu, CodeNamespace &namespaceName ) : CodeTypeDeclaration
ccu System.CodeDom.CodeCompileUnit
namespaceName System.CodeDom.CodeNamespace
return System.CodeDom.CodeTypeDeclaration

HasPartialClass() public static method

Reading the CodeCompileUnit, enumerate all NameSpaces, enumerate All Types, searching for the first Partial Class.
public static HasPartialClass ( CodeCompileUnit ccu, CodeNamespace &contextNameSpace, CodeTypeDeclaration &contextClass ) : bool
ccu System.CodeDom.CodeCompileUnit
contextNameSpace System.CodeDom.CodeNamespace The NameSpace in wich the partial Class is defined
contextClass System.CodeDom.CodeTypeDeclaration The found partial Class
return bool