本文整理汇总了C#中SPWebApplication.GetChild方法的典型用法代码示例。如果您正苦于以下问题:C# SPWebApplication.GetChild方法的具体用法?C# SPWebApplication.GetChild怎么用?C# SPWebApplication.GetChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPWebApplication
的用法示例。
在下文中一共展示了SPWebApplication.GetChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveCleanupTimerJob
private static void RemoveCleanupTimerJob(SPWebApplication webApplication)
{
foreach (var job in webApplication.JobDefinitions)
{
if (job.Name == CleanupLogListTimerJob.JobName)
{
job.Delete();
break;
}
}
var settings = webApplication.GetChild<CleanupLogListTimerJobSettings>(CleanupLogListTimerJobSettings.SettingsName);
if (settings != null) settings.Delete();
ULSLog.LogMessage("Sucessfully removed settings and timer job from Web Application.");
}
示例2: Load
/// <summary>
/// Loads the setting store for the farm provided, and creates the setting store if not found.
/// </summary>
/// <param name="webApp">The farm to use</param>
/// <returns>The setting store for farm level settings</returns>
public static WebAppSettingStore Load(SPWebApplication webApp)
{
var settingStore = webApp.GetChild<WebAppSettingStore>(WebAppSettingStore.StoreName);
return settingStore;
}
示例3: Create
/// <summary>
/// Creates the setting store for a web application
/// </summary>
/// <param name="webApp">The parent web app to store the settings</param>
/// <returns>The web app setting store instance</returns>
public static WebAppSettingStore Create(SPWebApplication webApp)
{
lock (createlock)
{
//load to make sure it wasn't already created in a race...
var settingStore = webApp.GetChild<WebAppSettingStore>(WebAppSettingStore.StoreName);
if (settingStore == null)
{
settingStore = new WebAppSettingStore(WebAppSettingStore.StoreName, webApp);
settingStore.Update();
}
return settingStore;
}
}
示例4: DeleteStore
/// <summary>
/// Removes the setting store. Warning, all settings will be lost when removed.
/// </summary>
/// <param name="webApp">The web app to clear the settings for</param>
public static void DeleteStore(SPWebApplication webApp)
{
var settingStore = webApp.GetChild<WebAppSettingStore>(WebAppSettingStore.StoreName);
if (settingStore != null)
{
settingStore.Delete();
}
}