本文整理汇总了C#中SIM.Instances.Instance.SetAppPoolMode方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.SetAppPoolMode方法的具体用法?C# Instance.SetAppPoolMode怎么用?C# Instance.SetAppPoolMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIM.Instances.Instance
的用法示例。
在下文中一共展示了Instance.SetAppPoolMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnsureFramework4
private bool EnsureFramework4(Window mainWindow, Instance instance)
{
// verify that .NET framework v4 is used
if (!instance.IsNetFramework4)
{
// suggest to install them
const string yesEnableSitecoreMvc = "Yes, switch to .NET 4.X";
const string noCancel = "No, cancel";
var options2 = new[]
{
noCancel, yesEnableSitecoreMvc
};
var result2 = WindowHelper.AskForSelection(".NET Framework 4.X is not set", null,
"You decided to enable Sitecore MVC, but it requiuires using .NET Framework 4.X in Sitecore instance's application pool for correct work. \n\nWould you like to change .NET Framework version?",
options2, mainWindow);
if (result2 == noCancel)
{
return false;
}
instance.SetAppPoolMode(true);
}
return true;
}
示例2: DoChangeMode
private void DoChangeMode(Window mainWindow, Instance instance)
{
var title = "Change App Pool Mode";
var header = title;
var message = "Change {0} instance's Application Pool mode".FormatWith(instance.Name);
var options = new[]
{
this.GetLabel(instance, 2, false),
this.GetLabel(instance, 2, true),
this.GetLabel(instance, 4, false),
this.GetLabel(instance, 4, true)
};
var result = WindowHelper.AskForSelection(title, header, message, options, mainWindow);
if (result == null)
{
return;
}
if (result.Contains(LabelCurrent))
{
return;
}
instance.SetAppPoolMode(result.Contains("4.0"), result.Contains(Label32Bit));
}