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


C# IProject.GetSolution方法代码示例

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


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

示例1: GetPublicKeyString

        private static string GetPublicKeyString(IProject project)
        {
            var solution = project.GetSolution();
            var snkProvider = solution.GetComponent<SnkDataProvider>();

            byte[] data = snkProvider.ProjectDataCache.GetData(snkProvider, project.ProjectFileLocation, null);
            return data?.Length > 0
                ? (SnkDataProvider.IsPublicKeyBlob(data) ? StringUtil.ToHexString(data) : null)
                : null;
        }
开发者ID:hmemcpy,项目名称:ReSharper.InternalsVisibleTo,代码行数:10,代码来源:ProjectReferenceLookupItem.cs

示例2: DoTest

        protected override void DoTest(IProject testProject)
        {
            IPsiServices psiServices = testProject.GetSolution().GetPsiServices();
            IContextBoundSettingsStore boundStore = psiServices.SettingsStore.BindToContextTransient(
                ContextRange.Smart(testProject.ToDataContext()));
            boundStore.SetValue<OrderUsingsSettings, string>(
                settings => settings.OrderSpecificationXml,
                "<Groups xmlns=\"http://schemas.interact-sw.co.uk/OrderUsings/2014\">" +
                "<Group Priority='1' NamespacePattern='System*' />" +
                "<Group Priority='1' NamespacePattern='Microsoft*' />" +
                "<Space />" +
                "<Group Priority='9999' NamespacePattern='*' />" +
                "<Space />" +
                "<Group Priority='9999' NamespacePattern='*' AliasPattern='*' Type='Alias' />" +
                "</Groups>");

            base.DoTest(testProject);
        }
开发者ID:DiomedesDominguez,项目名称:order-usings,代码行数:18,代码来源:WhenOrderIsWrong.cs

示例3: DoTest

 protected override void DoTest(IProject testProject)
 {
     testProject.GetSolution().GetPsiServices().Files.CommitAllDocuments();
     using (ITextControl textControl = OpenTextControl(testProject))
     {
         var document = textControl.Document;
         var psiSourceFile = document.GetPsiSourceFile(Solution);
         Assert.IsNotNull(psiSourceFile, "sourceFile == null");
         using (ReadLockCookie.Create())
         {
             var highlightingFinder = new IdentifierHighlightingFinder(psiSourceFile, new DocumentRange(document, new TextRange(textControl.Caret.Offset())));
             highlightingFinder.DoHighlighting(DaemonProcessKind.VISIBLE_DOCUMENT);
             var highlightingInfo = highlightingFinder.HighlightingInfo;
             Assertion.AssertNotNull(highlightingInfo, "Highlighting not found");
             var markupModel = Solution.GetComponent<IDocumentMarkupManager>().GetMarkupModel(document);
             var highlighterTooltipProvider = DaemonUtil.GetHighlighterTooltipProvider(highlightingInfo.Highlighting, Solution);
             var attributeId = HighlightingSettingsManager.Instance.GetAttributeId(highlightingInfo.Highlighting, psiSourceFile).NotNull();
             var highlighter = markupModel.AddHighlighter(new Key("test"), highlightingInfo.Range.TextRange, AreaType.EXACT_RANGE, 0, attributeId, new ErrorStripeAttributes(), highlighterTooltipProvider);
             ExecuteWithGold(writer => writer.WriteLine(highlighter.ToolTip));
         }
     }
 }
开发者ID:JetBrains,项目名称:resharper-unity,代码行数:22,代码来源:IdentifierTooltipTestBase.cs

示例4: DoTest

        protected override void DoTest(IProject testProject)
        {
            var caretPosition = GetCaretPosition();
            using (ITextControl textControl = OpenTextControl(testProject, caretPosition))
            {
                var caretOffset = textControl.Caret.Offset();
                var context = new TemplateAcceptanceContext(
                    testProject.GetSolution(),
                    textControl.Document,
                    caretOffset,
                    new TextRange(caretOffset));

                base.ExecuteWithGold(
                    sb =>
                    {
                        var sp = new CSharpExtendedScopeProvider();
                        foreach (string templateScopePoint in sp.ProvideScopePoints(context))
                        {
                            sb.Write(templateScopePoint);
                            sb.WriteLine();
                        }
                    });
            }
        }
开发者ID:johnmbaughman,项目名称:ZenSharp,代码行数:24,代码来源:CSharpExtendedScopeProviderTest.cs

示例5: T4PsiModule

        internal T4PsiModule([NotNull] Lifetime lifetime, [NotNull] PsiModuleManager psiModuleManager, [NotNull] DocumentManager documentManager,
            [NotNull] ChangeManager changeManager, [NotNull] IAssemblyFactory assemblyFactory, [NotNull] IShellLocks shellLocks,
            [NotNull] IProjectFile projectFile, [NotNull] T4FileDataCache fileDataCache, [NotNull] T4Environment t4Environment,
            [NotNull] OutputAssembliesCache outputAssembliesCache)
        {
            _lifetime = lifetime;
            lifetime.AddAction(Dispose);

            _psiModuleManager = psiModuleManager;
            _documentManager = documentManager;
            _assemblyFactory = assemblyFactory;

            _changeManager = changeManager;
            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, psiModuleManager, this);

            _shellLocks = shellLocks;
            _projectFile = projectFile;
            _project = projectFile.GetProject();
            Assertion.AssertNotNull(_project, "_project != null");
            _solution = _project.GetSolution();

            _t4Environment = t4Environment;
            _outputAssembliesCache = outputAssembliesCache;
            _resolveProject = new T4ResolveProject(_solution, _shellLocks, t4Environment.PlatformID, _project);

            _sourceFile = new PsiProjectFile(
                this,
                _projectFile,
                (pf, sf) => new DefaultPsiProjectFileProperties(pf, sf),
                JetFunc<IProjectFile, IPsiSourceFile>.True,
                _documentManager);

            _isValid = true;
            fileDataCache.FileDataChanged.Advise(lifetime, OnDataFileChanged);
            AddBaseReferences();
        }
开发者ID:sscctech,项目名称:ForTea,代码行数:37,代码来源:T4PsiModule.cs

示例6: GetTestMethod

 public static XunitTestMethodElement GetTestMethod(IProject project, XunitTestClassElement classElement, IClrTypeName typeName, string methodName)
 {
     var id = GetTestMethodId(classElement, typeName, methodName);
     var unitTestElementManager = project.GetSolution().GetComponent<IUnitTestElementManager>();
     return unitTestElementManager.GetElementById(project, id) as XunitTestMethodElement;
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:6,代码来源:UnitTestElementFactory.cs

示例7: GetTestTheory

 public static XunitTestTheoryElement GetTestTheory(IProject project, XunitTestMethodElement methodElement, string name)
 {
     var id = GetTestTheoryId(methodElement, GetTestTheoryShortName(name, methodElement));
     var unitTestElementManager = project.GetSolution().GetComponent<IUnitTestElementManager>();
     return unitTestElementManager.GetElementById(project, id) as XunitTestTheoryElement;
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:6,代码来源:UnitTestElementFactory.cs

示例8: GetTestCase

 public static IUnitTestElement GetTestCase(IProject project, TestMethodElement testMethod, string name)
 {
     var id = GetTestCaseId(testMethod, GetTestCaseShortName(name, testMethod));
     var unitTestElementManager = project.GetSolution().GetComponent<IUnitTestElementManager>();
     return unitTestElementManager.GetElementById(project, id) as TestCaseElement;
 }
开发者ID:TylerCarlson1,项目名称:ReSharperFixieRunner,代码行数:6,代码来源:UnitTestElementFactory.cs


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