internal StructCollectionWithCodeAnalysis(LoadedDocumentWithCodeAnalysis document) { members = document.Members; structs = new LoadedDocumentMemberListWrapper <StructWithCodeAnalysis, StructDeclarationSyntax>( document.Node, () => new StructWithCodeAnalysis(document.Document), syntax => !syntax.IsPartial()); partialStructs = new LoadedDocumentMemberListWrapper <PartialStructWithCodeAnalysis, StructDeclarationSyntax>( document.Node, () => new PartialStructWithCodeAnalysis(document.Document), StructDeclarationSyntaxExtensions.IsPartial); }
public DocumentWithCodeAnalysis AddDocument(string filePath, LoadedDocumentWithCodeAnalysis document) { string[] projectFolders = new Uri(Path.GetDirectoryName(filePath)) .MakeRelativeUri(new Uri(Path.GetDirectoryName(Syntax.FilePath))) .ToString() .Split('\\'); Document newDocument = Syntax.AddDocument( Path.GetFileNameWithoutExtension(filePath), document.Syntax, projectFolders, Path.GetFileName(filePath)); Syntax = newDocument.Project; return(new DocumentWithCodeAnalysis(newDocument)); }
internal ClassCollectionWithCodeAnalysis(LoadedDocumentWithCodeAnalysis document) { members = document.Members; abstractClasses = new LoadedDocumentMemberListWrapper<AbstractClassWithCodeAnalysis, ClassDeclarationSyntax>( document.Node, () => new AbstractClassWithCodeAnalysis(document.Document), ClassDeclarationSyntaxExtensions.IsAbstractClass); classes = new LoadedDocumentMemberListWrapper<ClassWithCodeAnalysis, ClassDeclarationSyntax>( document.Node, () => new ClassWithCodeAnalysis(document.Document), ClassDeclarationSyntaxExtensions.IsClass); sealedClasses = new LoadedDocumentMemberListWrapper<SealedClassWithCodeAnalysis, ClassDeclarationSyntax>( document.Node, () => new SealedClassWithCodeAnalysis(document.Document), ClassDeclarationSyntaxExtensions.IsSealedClass); staticClasses = new LoadedDocumentMemberListWrapper<StaticClassWithCodeAnalysis, ClassDeclarationSyntax>( document.Node, () => new StaticClassWithCodeAnalysis(document.Document), ClassDeclarationSyntaxExtensions.IsStaticClass); partialClasses = PartialClassCollectionWithCodeAnalysis.Create(document); }