当前位置: 首页>>代码示例>>C#>>正文


C# ICSharpFile.GetSolution方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:RainsSoft,项目名称:StyleCop,代码行数:78,代码来源:StyleCopStage.cs

示例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());
 }
开发者ID:RainsSoft,项目名称:StyleCop,代码行数:18,代码来源:DocumentationRules.cs


注:本文中的ICSharpFile.GetSolution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。