Esempio n. 1
0
        public INodeInfo[] ExtractNodeInfos(string filename, string arguments)
        {
            var result = new List <INodeInfo>();

            // Present the user with all files associated with this filename.
            var nodeInfo = CreateNodeInfo(filename);

            if (nodeInfo != null)
            {
                result.Add(nodeInfo);
            }

            if (FInOpen)
            {
                // Do we have a project file?
                // TODO: Do not hardcode project extension.
                if (Path.GetExtension(filename) == ".csproj")
                {
                    var project = FSolution.FindProject(filename);
                    if (project != null)
                    {
                        if (!project.IsLoaded)
                        {
                            project.Load();
                        }

                        foreach (var doc in project.Documents)
                        {
                            var docFilename = doc.Location.LocalPath;

                            if (docFilename != filename)
                            {
                                nodeInfo = CreateNodeInfo(doc.Location.LocalPath);
                                if (nodeInfo != null)
                                {
                                    result.Add(nodeInfo);
                                }
                            }
                        }
                    }
                }
            }

            return(result.ToArray());
        }
Esempio n. 2
0
 private static IProject FindProject(ISolution solution, string project)
 {
     try
     {
         return(solution.FindProject(project));
     }
     catch (Exception e)
     {
         console.WriteLine(e.Message);
         return(null);
     }
 }