public ClassStructure(ClassDeclarationSyntax csd, NamespaceDeclarationSyntax ns, List <MetadataReference> references, IEnumerable <UsingDirectiveSyntax> usings, string filename, string path) { if (string.IsNullOrEmpty(filename) || string.IsNullOrEmpty(path)) { throw new ArgumentNullException(); } _namespace = ns; _filename = filename; _path = path; _classdeclaration = csd; _classname = _classdeclaration.Identifier.ToString(); _usingDirectives = new List <UsingDirectiveSyntax>(usings); _references = references; _compilation = new Lazy <CSharpCompilation>(() => GenerateCompilation(_namespace.ToString(), _references, csd.SyntaxTree)); _semanticModel = new Lazy <SemanticModel>(() => _compilation.Value.GetSemanticModel(csd.SyntaxTree)); }