本文整理汇总了C#中IProjectContent.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectContent.Dispose方法的具体用法?C# IProjectContent.Dispose怎么用?C# IProjectContent.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProjectContent
的用法示例。
在下文中一共展示了IProjectContent.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnloadProjectContent
/// <summary>
/// Unloads the specified project content, causing it to be reloaded when
/// GetProjectContentForReference is called the next time.
/// Warning: do not unload project contents that are still in use! Doing so will result
/// in an ObjectDisposedException when the unloaded project content is used the next time!
/// </summary>
public void UnloadProjectContent(IProjectContent pc)
{
if (pc == null)
throw new ArgumentNullException("pc");
LoggingService.Debug("ProjectContentRegistry.UnloadProjectContent: " + pc);
lock (contents) {
// find all keys used for the project content - might be the short name/full name/file name
List<string> keys = new List<string>();
foreach (KeyValuePair<string, IProjectContent> pair in contents) {
if (pair.Value == pc) keys.Add(pair.Key);
}
foreach (string key in keys) {
contents.Remove(key);
}
}
pc.Dispose();
}