本文整理汇总了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);
}
示例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);
}
示例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);
}