本文整理汇总了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;
}
示例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);
}
示例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));
}
}
}
示例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();
}
});
}
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}