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


C# IProjectItem.GetProject方法代码示例

本文整理汇总了C#中IProjectItem.GetProject方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectItem.GetProject方法的具体用法?C# IProjectItem.GetProject怎么用?C# IProjectItem.GetProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProjectItem的用法示例。


在下文中一共展示了IProjectItem.GetProject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindSettingsFilePath

        /// <summary>
        /// Searches directories of the project items project file and the parents thereof to see 
        /// if a Settings file exists.
        /// </summary>
        /// <param name="projectItem">
        /// File being examined.
        /// </param>
        /// <returns>
        /// Path to the settings file.
        /// </returns>
        public string FindSettingsFilePath(IProjectItem projectItem)
        {
            StyleCopTrace.In(projectItem);

            string cacheKey = string.Format("{0}::{1}", "FindSettingsFilePath", projectItem.Location.FullPath.ToLowerInvariant());

            string settings;

            if (StringCache.TryGetValue(cacheKey, out settings))
            {
                StyleCopTrace.Out();

                return settings;
            }

            IProject projectFile = projectItem.GetProject();

            string result = this.FindSettingsFilePath(projectFile);

            // TODO: This is adding a watcher for settings.stylecop in the folder of the source file
            // This is creating a watcher for *ALL* source files that are monitored!
            this.AddWatcherForSettingsFile(projectItem.Location.FullPath);
            StringCache[cacheKey] = result;

            return StyleCopTrace.Out(result);
        }
开发者ID:icnocop,项目名称:StyleCop,代码行数:36,代码来源:StyleCopSettings.cs

示例2: FindSettingsFilePath

        /// <summary>
        /// Searches directories of the project items project file and the parents thereof to see if a Settings file exists.
        /// </summary>
        /// <param name="projectItem">
        /// File being examined. 
        /// </param>
        /// <returns>
        /// Path to the settings file. 
        /// </returns>
        public string FindSettingsFilePath(IProjectItem projectItem)
        {
            StyleCopTrace.In(projectItem);

            string cacheKey = string.Format("{0}::{1}", "FindSettingsFilePath", projectItem.Location.FullPath.ToLowerInvariant());

            string settings;

            if (StringCache.TryGetValue(cacheKey, out settings))
            {
                StyleCopTrace.Out();

                return settings;
            }

            IProject projectFile = projectItem.GetProject();

            string result = this.FindSettingsFilePath(projectFile);

            StringCache[cacheKey] = result;

            return StyleCopTrace.Out(result);
        }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:32,代码来源:StyleCopSettings.cs

示例3: FindSettingsFilePath

        /// <summary>
        /// Searches directories of the project items project file and the parents thereof to see 
        /// if a Settings file exists.
        /// </summary>
        /// <param name="projectItem">
        /// File being examined.
        /// </param>
        /// <returns>
        /// Path to the settings file.
        /// </returns>
        private string FindSettingsFilePath(IProjectItem projectItem)
        {
            StyleCopTrace.In(projectItem);

            string cacheKey = projectItem.Location.FullPath.ToLowerInvariant();

            string settings;

            if (this.settingsFilePathForProjectFile.TryGetValue(cacheKey, out settings))
            {
                StyleCopTrace.Out();

                return settings;
            }

            IProject projectFile = projectItem.GetProject();

            string result = this.FindSettingsFilePath(projectFile);

            // TODO: This makes no sense
            // We cache, per source file location, the location of the settings.stylecop file.
            // We only look for the settings.stylecop file at the project root folder and above.
            // But we add a file watcher at the source file location
            // this.AddWatcherForSettingsFile(projectItem.Location.FullPath);
            this.settingsFilePathForProjectFile[cacheKey] = result;

            return StyleCopTrace.Out(result);
        }
开发者ID:RainsSoft,项目名称:StyleCop,代码行数:38,代码来源:StyleCopSettings.cs


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