本文整理汇总了C#中IResourceManager.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceManager.Add方法的具体用法?C# IResourceManager.Add怎么用?C# IResourceManager.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResourceManager
的用法示例。
在下文中一共展示了IResourceManager.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RecordingPlanner
/// <summary>
/// Erstellt eine neue Planung.
/// </summary>
/// <param name="site">Die zugehörige Arbeitsumgebung.</param>
private RecordingPlanner( IRecordingPlannerSite site )
{
// Remember
m_site = site;
// Process all profiles
foreach (var profileName in site.ProfileNames)
{
// Look up the profile
var profile = ProfileManager.FindProfile( profileName );
if (profile == null)
continue;
// Create the resource for it
var profileResource = ProfileScheduleResource.Create( profileName );
// Remember
m_resources.Add( profileName, profileResource );
// See if this is a leaf profile
if (!string.IsNullOrEmpty( profile.UseSourcesFrom ))
continue;
// See if we should process guide updates
var guideTask = site.CreateProgramGuideTask( profileResource, profile );
if (guideTask != null)
m_tasks.Add( guideTask );
// See if we should update the source list
var scanTask = site.CreateSourceScanTask( profileResource, profile );
if (scanTask != null)
m_tasks.Add( scanTask );
}
// Make sure we report all errors
try
{
// Create the manager
m_manager = ResourceManager.Create( site.ScheduleRulesPath, ProfileManager.ProfileNameComparer );
}
catch (Exception e)
{
// Report
VCRServer.LogError( Properties.Resources.BadRuleFile, e.Message );
// Use standard rules
m_manager = ResourceManager.Create( ProfileManager.ProfileNameComparer );
}
// Safe configure it
try
{
// All all resources
foreach (var resource in m_resources.Values)
m_manager.Add( resource );
}
catch (Exception e)
{
// Cleanup
Dispose();
// Report
VCRServer.Log( e );
}
}