本文整理汇总了C#中ICSharpFile.GetSolution方法的典型用法代码示例。如果您正苦于以下问题:C# ICSharpFile.GetSolution方法的具体用法?C# ICSharpFile.GetSolution怎么用?C# ICSharpFile.GetSolution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpFile
的用法示例。
在下文中一共展示了ICSharpFile.GetSolution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateProcess
/// <summary>
/// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document.
/// </summary>
/// <param name="process">
/// Current Daemon Process.
/// </param>
/// <param name="settingsStore">
/// The settingsStore store to use.
/// </param>
/// <param name="processKind">
/// The process kind.
/// </param>
/// <param name="file">
/// The file to analyze.
/// </param>
/// ///
/// <returns>
/// The current <see cref="IDaemonStageProcess"/>.
/// </returns>
protected override IDaemonStageProcess CreateProcess(
IDaemonProcess process, IContextBoundSettingsStore settingsStore, DaemonProcessKind processKind, ICSharpFile file)
{
StyleCopTrace.In(process, settingsStore, processKind, file);
if (process == null)
{
throw new ArgumentNullException("process");
}
try
{
if (processKind == DaemonProcessKind.OTHER)
{
StyleCopTrace.Info("ProcessKind Other.");
StyleCopTrace.Out();
return null;
}
if (!settingsStore.GetValue<StyleCopOptionsSettingsKey, bool>(key => key.AnalysisEnabled))
{
StyleCopTrace.Info("Analysis disabled.");
StyleCopTrace.Out();
return null;
}
if (!this.IsSupported(process.SourceFile))
{
StyleCopTrace.Info("File type not supported.");
StyleCopTrace.Out();
return null;
}
if (!this.FileIsValid(file))
{
StyleCopTrace.Info("Source file not valid.");
StyleCopTrace.Out();
return null;
}
if (!settingsStore.GetValue<StyleCopOptionsSettingsKey, bool>(key => key.AnalyzeReadOnlyFiles))
{
if (process.SourceFile.Properties.IsNonUserFile)
{
StyleCopTrace.Info("Not analysing non user files.");
StyleCopTrace.Out();
return null;
}
}
IDaemon daemon = file.GetSolution().GetComponent<IDaemon>();
return StyleCopTrace.Out(new StyleCopStageProcess(this.lifetime, this.apiPool, daemon, process, this.threading, file));
}
catch (JetBrains.Application.Progress.ProcessCancelledException)
{
return null;
}
}
示例2: GetDocumentationRulesConfig
/// <summary>
/// Returns a config object exposing the current config settings for this file.
/// </summary>
/// <param name="lifetime">
/// The lifetime of the settings for the configuration.
/// </param>
/// <param name="file">
/// The file to get the config for.
/// </param>
/// <returns>
/// The configuration for the given file.
/// </returns>
private static DocumentationRulesConfiguration GetDocumentationRulesConfig(Lifetime lifetime, ICSharpFile file)
{
// TODO: We shouldn't have to resort to service locator!
var api = file.GetSolution().GetComponent<StyleCopApiPool>().GetInstance(lifetime);
return new DocumentationRulesConfiguration(api.Settings, file.GetSourceFile());
}