本文整理汇总了C#中IProjectFile类的典型用法代码示例。如果您正苦于以下问题:C# IProjectFile类的具体用法?C# IProjectFile怎么用?C# IProjectFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProjectFile类属于命名空间,在下文中一共展示了IProjectFile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
});
}
开发者ID:xsburg,项目名称:ReSharper.NTriples,代码行数:28,代码来源:NTriplesLexerTestBase.cs
示例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;
}
开发者ID:hazzik,项目名称:ReSharper.NHibernate,代码行数:9,代码来源:MappingFileProjectFileLanguageService.cs
示例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));
}
开发者ID:vilinski,项目名称:vilinski.net,代码行数:27,代码来源:BusinessObjectRelatedFilesProvider.cs
示例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));
}
开发者ID:paulbatum,项目名称:storevil,代码行数:7,代码来源:DispositionBuilder.cs
示例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;
}
开发者ID:hazzik,项目名称:ReSharper.NHibernate,代码行数:7,代码来源:MappingFileDaemonBehaviour.cs
示例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;
}
开发者ID:mnaoumov,项目名称:ForTea,代码行数:8,代码来源:T4PsiModuleProvider.cs
示例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;
}
开发者ID:willrawls,项目名称:arp,代码行数:15,代码来源:NHSupportedByPSIChecker.cs
示例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;
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:16,代码来源:Block.cs
示例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;
}
开发者ID:willrawls,项目名称:arp,代码行数:13,代码来源:ReferencesSearcher.cs
示例10: GetPsiProperties
public override IPsiSourceFileProperties GetPsiProperties(IProjectFile projectFile, IPsiSourceFile sourceFile)
{
if (!projectFile.IsProjectReferencingNancyRazorViewEngine())
{
return base.GetPsiProperties(projectFile, sourceFile);
}
return new RazorMvcPsiProjectFileProperties(projectFile, sourceFile);
}
开发者ID:jimmason,项目名称:Nancy.ReSharper,代码行数:9,代码来源:RazorCSharpNancyProjectFileLanguageService.cs
示例11: GetPsiLanguageType
public PsiLanguageType GetPsiLanguageType(IProjectFile file)
{
if (file == null)
{
return PsiLanguageType.UNKNOWN;
}
return GetPsiLanguageType(file.LanguageType);
}
开发者ID:willrawls,项目名称:arp,代码行数:9,代码来源:L4NProjectFileLanguageService.cs
示例12: GetPsiLanguageType
public override PsiLanguageType GetPsiLanguageType(IProjectFile projectFile)
{
if (projectFile.IsProjectReferencingNancyRazorViewEngine())
{
return GetPsiLanguageType(projectFile.LanguageType);
}
return base.GetPsiLanguageType(projectFile);
}
开发者ID:jimmason,项目名称:Nancy.ReSharper,代码行数:9,代码来源:RazorCSharpNancyProjectFileLanguageService.cs
示例13: TryRemoveFile
public void TryRemoveFile(IProjectFile file)
{
XXLanguageXXFile result;
if (_filesMap.TryGetValue(file, out result))
{
_filePathsMap.Remove(result.FullName);
result.Dispose();
_filesMap.Remove(file);
}
}
开发者ID:derigel23,项目名称:Nitra,代码行数:10,代码来源:Project.cs
示例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();
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:11,代码来源:ucAnalysisErrorEditor.cs
示例15: IsIgnoredFile
private bool IsIgnoredFile(IProjectFile projectFile)
{
foreach (Regex spec in SpecsToIgnore)
{
if (spec.IsMatch(projectFile.Location.Name))
{
return true;
}
}
return false;
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:11,代码来源:SimianProjectVisitor.cs
示例16: GetDocumentRange2
private DocumentRange? GetDocumentRange2(string sourceFile, IProjectFile projectFile, int startLineNumber, int endLineNumber)
{
try
{
return GetDocumentRange(projectFile, startLineNumber, endLineNumber, solution);
}
catch (ArgumentOutOfRangeException)
{
FilesInError.Add(projectFile);
return null;
}
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:12,代码来源:SimianResultsParser.cs
示例17: 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
示例18: GetProjectFileType
public ProjectFileType GetProjectFileType(IProjectFile file)
{
if (file == null)
{
return ProjectFileType.UNKNOWN;
}
if (IsNHFile(file))
return NH;
return null;
}
开发者ID:willrawls,项目名称:arp,代码行数:12,代码来源:NHProjectFileLanguageService.cs
示例19: 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)
{
FixLangServiceOrder();
if (projectFile.Name.EndsWith(NHProjectFileLanguageService.HBM_SUFFIX))
return BuildPsiResult.DO_BUILD;
if (projectFile.LanguageType != NHProjectFileLanguageService.NH)
{
return BuildPsiResult.UNDEF;
}
return BuildPsiResult.DO_BUILD;
}
开发者ID:willrawls,项目名称:arp,代码行数:20,代码来源:NHSupportedByPSIChecker.cs
示例20: GetDocumentRange
public static DocumentRange GetDocumentRange(IProjectFile projectFile, int startLineNumber, int endLineNumber, ISolution solution)
{
if (startLineNumber > endLineNumber)
throw new ArgumentException("start line must come before end line.");
DocumentManager documentManager = DocumentManager.GetInstance(solution);
IDocument document = documentManager.GetProjectFile(projectFile);
int startOffset = document.GetLineStartOffset((Int32<DocLine>) (startLineNumber-1));
int endOffset = document.GetLineEndOffsetNoLineBreak((Int32<DocLine>) (endLineNumber-1));
return new DocumentRange(document, new TextRange(startOffset, endOffset));
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:13,代码来源:SimianResultsParser.cs
注:本文中的IProjectFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论