本文整理汇总了C#中IProject.GetResolveContext方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.GetResolveContext方法的具体用法?C# IProject.GetResolveContext怎么用?C# IProject.GetResolveContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProject
的用法示例。
在下文中一共展示了IProject.GetResolveContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDeclaredElement
public IDeclaredElement GetDeclaredElement(IProject project, IClrTypeName typeName)
{
var modules = psiServices.Modules;
var psiModule = modules.GetPrimaryPsiModule(project);
if (psiModule == null)
return null;
var symbolScope = psiServices.Symbols.GetSymbolScope(psiModule, project.GetResolveContext(), true, true);
return symbolScope.GetTypeElementByCLRName(typeName);
}
示例2: OverrideHandler
public JetTuple<IProjectPsiModuleHandler, IPsiModuleDecorator> OverrideHandler(Lifetime lifetime, IProject project, IProjectPsiModuleHandler handler)
{
if (project.ProjectProperties.ProjectKind != ProjectKind.REGULAR_PROJECT ||
project.ProjectFileLocation.IsNullOrEmpty())
{
return null;
}
ExternalCodeSettingsKey settingsKey = _settingsStore
.BindToContextTransient(ContextRange.ApplicationWide)
.GetKey<ExternalCodeSettingsKey>(SettingsOptimization.OptimizeDefault);
IEnumerable<string> paths = settingsKey
.Paths
.EnumIndexedValues()
.Select(x => x.Value.Trim())
.Distinct();
FileSystemPath[] fileSystemPaths = paths
.Select(FileSystemPath.TryParse)
.Where(x => !x.IsEmpty)
.Select(x => x.ToAbsolutePath(project.Location))
.ToArray();
var projectHandler = new GeneratedFilesProjectHandler(
_shellLocks,
_documentManager,
_projectFileExtensions,
_projectFileTypeCoordinator,
lifetime,
project,
handler,
_changeManager,
_fileSystemTracker,
f => new ExternalSourceFileProperties(project, f),
project.GetResolveContext(),
fileSystemPaths);
return new JetTuple<IProjectPsiModuleHandler, IPsiModuleDecorator>(projectHandler, new GeneratedFilesProjectDecorator(projectHandler));
}