C# 클래스 MixinRefactoring.Test.SourceCode

helper class for interaction with source code. The class takes several source code files as parameters and allows access to the syntax and semantic information of the classes. This class now also has a fluent API to add source code on the fly. Before using the fluent API, ensure that you call New() to erase all existing content (if desired) and at the end, call Compile() to generate a compilation unit and a semantic model from the collected source code.
파일 보기 프로젝트 열기: pgenfer/mixinSharp 1 사용 예제들

공개 메소드들

메소드 설명
AddFiles ( ) : SourceCode

add new files to the list of files for this source code

AddSource ( string content ) : SourceCode

adds the content of a file to this source code

Class ( string className ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
Compile ( ) : void

creates the semantic model out of all the source code that was added to this instance

CompileFromAssemblyOfType ( Type externalType ) : void
CreateClass ( string className ) : ClassWithSourceCode
GetTypeByName ( string className ) : ITypeSymbol
MixinInClass ( string className, string mixin ) : Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax
New ( ) : SourceCode

fluent API, resets the file list that were used to generate the source code

SourceCode ( ) : Microsoft.CodeAnalysis

비공개 메소드들

메소드 설명
CreateSemanticModelFromSource ( IEnumerable fileContent ) : void

메소드 상세

AddFiles() 공개 메소드

add new files to the list of files for this source code
public AddFiles ( ) : SourceCode
리턴 SourceCode

AddSource() 공개 메소드

adds the content of a file to this source code
public AddSource ( string content ) : SourceCode
content string
리턴 SourceCode

Class() 공개 메소드

public Class ( string className ) : Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
className string
리턴 Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax

Compile() 공개 메소드

creates the semantic model out of all the source code that was added to this instance
public Compile ( ) : void
리턴 void

CompileFromAssemblyOfType() 공개 메소드

public CompileFromAssemblyOfType ( Type externalType ) : void
externalType System.Type
리턴 void

CreateClass() 공개 메소드

public CreateClass ( string className ) : ClassWithSourceCode
className string
리턴 ClassWithSourceCode

GetTypeByName() 공개 메소드

public GetTypeByName ( string className ) : ITypeSymbol
className string
리턴 ITypeSymbol

MixinInClass() 공개 메소드

public MixinInClass ( string className, string mixin ) : Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax
className string
mixin string
리턴 Microsoft.CodeAnalysis.CSharp.Syntax.FieldDeclarationSyntax

New() 공개 메소드

fluent API, resets the file list that were used to generate the source code
public New ( ) : SourceCode
리턴 SourceCode

SourceCode() 공개 메소드

public SourceCode ( ) : Microsoft.CodeAnalysis
리턴 Microsoft.CodeAnalysis