当前位置: 首页>>代码示例>>C#>>正文


C# IProjectFile.GetProject方法代码示例

本文整理汇总了C#中IProjectFile.GetProject方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectFile.GetProject方法的具体用法?C# IProjectFile.GetProject怎么用?C# IProjectFile.GetProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProjectFile的用法示例。


在下文中一共展示了IProjectFile.GetProject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NBehaveUnitTestElementBase

        protected NBehaveUnitTestElementBase(IProjectFile featureFile, IUnitTestProvider testProvider, string id, ProjectModelElementEnvoy pointer, NBehaveUnitTestElementBase parent)
        {
            FeatureFile = featureFile;
            //FeatureFile = featureFile.Location.FullPath;
            _project = featureFile.GetProject();
            //ProjectFile = _project.Name;

            _testProvider = testProvider;
            _id = id;
            _projectModel = pointer;
            Parent = parent;
        }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:12,代码来源:NBehaveUnitTestElementBase.cs

示例2: XunitFileExplorer

        public XunitFileExplorer([NotNull] XunitElementFactory factory, [NotNull] ITreeNode file, [NotNull] SearchDomainFactory searchDomainFactory, UnitTestElementLocationConsumer consumer, CheckForInterrupt interrupted)
        {
            if (factory == null) 
                throw new ArgumentNullException("factory");
            if (searchDomainFactory == null) 
                throw new ArgumentNullException("searchDomainFactory");
            if (file == null)
                throw new ArgumentNullException("file");

            this.factory = factory;
            this.searchDomainFactory = searchDomainFactory;
            this.consumer = consumer;
            this.interrupted = interrupted;

            projectFile = file.GetSourceFile().ToProjectFile();
            if (projectFile != null) project = projectFile.GetProject();
            envoy = ProjectModelElementEnvoy.Create(project);
        }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:18,代码来源:XunitFileExplorer.cs

示例3: GetNitraFile

    public XXLanguageXXFile GetNitraFile(IProjectFile projectFile)
    {
      var project = projectFile.GetProject();
      if (project == null)
        return null;

      XXLanguageXXProject nitraLangProject;

      if (!_projectsMap.TryGetValue(project, out nitraLangProject))
        return null;

      return nitraLangProject.TryGetFile(projectFile);
    }
开发者ID:derigel23,项目名称:Nitra,代码行数:13,代码来源:Solution.cs

示例4: OnFileChanged

    private bool OnFileChanged(IProjectFile projectFile, DocumentChange documentChange)
    {
      var project = projectFile.GetProject();
      if (project != null)
      {
        XXLanguageXXProject nitraProject;
        if (_projectsMap.TryGetValue(project, out nitraProject))
        {
          var nitraFile = nitraProject.TryGetFile(projectFile);
          if (nitraFile != null)
          {
            nitraFile.OnFileChanged(documentChange);
            return true;
          }
        }
      }

      return false;
    }
开发者ID:derigel23,项目名称:Nitra,代码行数:19,代码来源:Solution.cs

示例5: GetRelatedFiles

        public IEnumerable<Tuple<IProjectFile, string, IProjectFile>> GetRelatedFiles(IProjectFile projectFile)
        {
            var typeNamesInFile = GetTypeNamesDefinedInFile(projectFile).ToList();

            var candidateTypeNames = GetTypeCandidates(typeNamesInFile);

            // Look for the candidate types in the solution.
            var solution = projectFile.GetSolution();
            var candidateTypes = new List<IClrDeclaredElement>();
            foreach (var candidateTypeName in candidateTypeNames)
            {
                var types = FindType(solution, candidateTypeName);
                candidateTypes.AddRange(types);
            }

            // Get the source files for each of the candidate types.
            var sourceFiles = new List<IPsiSourceFile>();
            foreach (var type in candidateTypes)
            {
                var sourceFilesForCandidateType = type.GetSourceFiles();
                sourceFiles.AddRange(sourceFilesForCandidateType);
            }

            var elementCollector = new RecursiveElementCollector<ITypeDeclaration>();
            foreach (var psiSourceFile in sourceFiles)
                foreach (var file in psiSourceFile.EnumerateDominantPsiFiles())
                    elementCollector.ProcessElement(file);

            var elements = elementCollector.GetResults();
            var projectFiles = elements.Select(declaration => declaration.GetSourceFile().ToProjectFile());

            var thisProjectName = projectFile.GetProject()?.Name;

            var rval = new List<Tuple<IProjectFile, string, IProjectFile>>();
            foreach (var file in projectFiles.OfType<ProjectFileImpl>().Distinct(pf => pf.Location.FullPath))
            {
                // Remove all extensions (e.g.: .xaml.cs).
                var fn = file.Name;
                var dotPos = fn.IndexOf('.');
                if (dotPos != -1)
                {
                    fn = fn.Substring(0, dotPos);
                }

                var display = fn.EndsWith("ViewModel") ? "ViewModel" : "View";

                var projectName = file.GetProject()?.Name;

                if (projectName != null &&
                    !string.Equals(thisProjectName, projectName, StringComparison.OrdinalIgnoreCase))
                {
                    display += $" (in {projectName})";
                }

                var tuple = Tuple.Create((IProjectFile)file, display, projectFile);

                rval.Add(tuple);
            }

            return rval;
        }
开发者ID:hmemcpy,项目名称:ReSharper.Xao,代码行数:61,代码来源:ViewModelRelatedFilesProvider.cs


注:本文中的IProjectFile.GetProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。