Skip to content

Commit

Permalink
added project .cs files to reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinKa committed May 1, 2019
1 parent 6b04647 commit a0e8e41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NetPrintsVSIX/NetPrintsEditorFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public int CreateEditorInstance(uint grfCreateDoc, string pszMkDocument, string
// Add referenced assemblies
var assemblyPaths = package.GetAssemblyReferences().Select(assemblyRef => assemblyRef.AssemblyPath);

// TODO: Get .cs files
var sourcePaths = new string[0];
// Get source files in projects
var sourcePaths = package.GetSourceDirectoryReferences().SelectMany(sourceRef => sourceRef.SourceFilePaths);

// Add our own sources
var sources = package.GetGeneratedCode();
Expand Down
9 changes: 9 additions & 0 deletions NetPrintsVSIX/NetPrintsVSIXPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ public IEnumerable<AssemblyReference> GetAssemblyReferences()
.Select(r => new AssemblyReference(r.Path)));
}

public IEnumerable<SourceDirectoryReference> GetSourceDirectoryReferences()
{
ThreadHelper.ThrowIfNotOnUIThread();

return dte.Solution.Projects
.OfType<EnvDTE.Project>()
.Select(proj => new SourceDirectoryReference(Path.GetDirectoryName(proj.FileName)));
}

public IEnumerable<string> GetGeneratedCode()
{
ClassTranslator classTranslator = new ClassTranslator();
Expand Down

0 comments on commit a0e8e41

Please sign in to comment.