本文整理汇总了C#中IProjectFile类的典型用法代码示例。如果您正苦于以下问题:C# IProjectFile类的具体用法?C# IProjectFile怎么用?C# IProjectFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProjectFile类属于命名空间,在下文中一共展示了IProjectFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckOutput
private void CheckOutput(IProjectFile projectFile, Encoding encoding)
{
Assert.IsNotNull(projectFile, "projectFile == null");
this.ExecuteWithGold(
projectFile.Location.Name,
sw =>
{
using (var sr = new StreamReader(projectFile.Location.OpenFileForReadingExclusive(), encoding, true))
{
var lexer = this.CreateLexer(projectFile, sr);
int position = 0;
lexer.Start();
while (lexer.TokenType != null)
{
Assert.AreEqual(
lexer.TokenStart,
position,
"Token start error. Expected: {0}, actual: {1}",
position,
lexer.TokenStart);
position = lexer.TokenEnd;
this.WriteToken(sw, lexer);
lexer.Advance();
}
Assert.AreEqual(lexer.Buffer.Length, position, "position == lexer.Buffer.Length");
}
});
}
示例2: GetProjectFileType
//private readonly IWordIndexLanguageProvider m_WordIndexLanguageProvider = new XmlWordIndexLanguageProvider();
public ProjectFileType GetProjectFileType(IProjectFile file) {
//Logger.LogMessage("MappingFileProjectFileLanguageService.GetProjectFileType for file {0}", file.Name);
if (file.Name.EndsWith(Constants.MappingFileExtension)) {
return MAPPING_FILE;
}
return ProjectFileType.UNKNOWN;
}
示例3: GetRelatedFiles
public IEnumerable<JetTuple<IProjectFile, string>> GetRelatedFiles(IProjectFile projectFile)
{
return new List<JetTuple<IProjectFile, string>>();
// IDeclarationsCache dc = CacheManager.GetInstance(_provider.Solution).GetDeclarationsCache(
//_provider.PsiModule, true, true);
// var inheritors = dc.GetPossibleInheritors("BuisnessObjectBuilder").Select(type => type.GetAttributeInstances());
// var shortNames = dc.GetAllShortNames();
// foreach (var file in projectFile.EnumeratePsiFiles().OfType<ICSharpFile>())
// {
// var classDeclaration =file.Get
// var attribute = file.GetContainingNode<IAttribute>();
// if (attribute != null)
// {
// var literal = attribute.Arguments.OfType<ICSharpLiteralExpression>();
// //TODO get value and compare with class's name
// }
// }
// // original implementation
// return
// from file in projectFile.EnumeratePsiFiles()
// from reference in new ReferenceCollector<IPathReference>().Process(file).References
// where reference.CheckResolveResult() == ResolveErrorType.OK
// let declaredElement = reference.Resolve().DeclaredElement
// where declaredElement != null
// from a in declaredElement.GetSourceFiles().SelectNotNull(f => f.ToProjectFile())
// select JetTuple.Of(a, GetRelationPresentation(reference));
}
示例4: BuildDisposition
public static UnitTestElementDisposition BuildDisposition(UnitTestElement element, ScenarioLocation location, IProjectFile projectFile)
{
var contents = File.ReadAllText(location.Path);
var range = new TextRange(LineToOffset(contents, location.FromLine), LineToOffset(contents, location.ToLine));
return new UnitTestElementDisposition(element, projectFile, range, new TextRange(0));
}
示例5: InitialErrorStripe
public ErrorStripeRequest InitialErrorStripe(IProjectFile file) {
if (PsiSupportManager.Instance.ShouldBuildPsi(file) &&
(ProjectFileLanguageServiceManager.Instance.GetPsiLanguageType(file) == MappingFileLanguageService.MAPPING_FILE)) {
return ErrorStripeRequest.STRIPE_AND_ERRORS;
}
return ErrorStripeRequest.NONE;
}
示例6: GetPsiSourceFilesFor
internal IList<IPsiSourceFile> GetPsiSourceFilesFor(IProjectFile projectFile) {
_shellLocks.AssertReadAccessAllowed();
ModuleWrapper wrapper;
return projectFile != null && projectFile.IsValid() && _modules.TryGetValue(projectFile, out wrapper) && wrapper.Module.IsValid()
? new[] { wrapper.Module.SourceFile }
: EmptyList<IPsiSourceFile>.InstanceList;
}
示例7: Check
///<summary>
///
/// If any of the registered checked answer
///<c>true</c> for the given project file, then PSI will be built
///
///</summary>
///
public BuildPsiResult Check(IProjectFile projectFile)
{
if (projectFile.LanguageType != NHProjectFileLanguageService.NH)
{
return BuildPsiResult.UNDEF;
}
return BuildPsiResult.DO_BUILD;
}
示例8: Block
/// <summary>
///
/// </summary>
/// <param name="startLineNumber">Indexed from 1</param>
/// <param name="endLineNumber">Indexed from 1</param>
/// <param name="projectFile"></param>
/// <param name="set"></param>
/// <param name="range"></param>
public Block(int startLineNumber, int endLineNumber, IProjectFile projectFile, Set set, DocumentRange? range)
{
Range = range;
this.set = set;
this.projectFile = projectFile;
this.startLineNumber = startLineNumber;
this.endLineNumber = endLineNumber;
}
示例9: ProcessProjectItem
///<returns>
///True if further search is not needed
///</returns>
///
public bool ProcessProjectItem(IProjectFile projectItem)
{
IFile psiFile = PsiManager.GetInstance(projectItem.GetSolution()).GetPsiFile(projectItem);
if (psiFile != null)
{
return this.ProcessElement(psiFile);
}
return false;
}
示例10: GetPsiProperties
public override IPsiSourceFileProperties GetPsiProperties(IProjectFile projectFile, IPsiSourceFile sourceFile)
{
if (!projectFile.IsProjectReferencingNancyRazorViewEngine())
{
return base.GetPsiProperties(projectFile, sourceFile);
}
return new RazorMvcPsiProjectFileProperties(projectFile, sourceFile);
}
示例11: GetPsiLanguageType
public PsiLanguageType GetPsiLanguageType(IProjectFile file)
{
if (file == null)
{
return PsiLanguageType.UNKNOWN;
}
return GetPsiLanguageType(file.LanguageType);
}
示例12: GetPsiLanguageType
public override PsiLanguageType GetPsiLanguageType(IProjectFile projectFile)
{
if (projectFile.IsProjectReferencingNancyRazorViewEngine())
{
return GetPsiLanguageType(projectFile.LanguageType);
}
return base.GetPsiLanguageType(projectFile);
}
示例13: TryRemoveFile
public void TryRemoveFile(IProjectFile file)
{
XXLanguageXXFile result;
if (_filesMap.TryGetValue(file, out result))
{
_filePathsMap.Remove(result.FullName);
result.Dispose();
_filesMap.Remove(file);
}
}
示例14: Reset
public void Reset(IProjectFile<string> file, TemplateContentLanguage language)
{
if (file.HasContents == false)
throw new ArgumentException("file must have contents");
this.file = file;
editor.Text = file.GetContents();
editor.Document.Language = SyntaxEditorHelper.GetDynamicLanguage(language);
errorTreeList.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
Reparse();
}
示例15: IsIgnoredFile
private bool IsIgnoredFile(IProjectFile projectFile)
{
foreach (Regex spec in SpecsToIgnore)
{
if (spec.IsMatch(projectFile.Location.Name))
{
return true;
}
}
return false;
}