本文整理汇总了C#中SR类的典型用法代码示例。如果您正苦于以下问题:C# SR类的具体用法?C# SR怎么用?C# SR使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SR类属于命名空间,在下文中一共展示了SR类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
private void Execute(SR sr)
{
if (CanReattachSR(sr))
{
MainWindowCommandInterface.ShowPerConnectionWizard(sr.Connection, new NewSRWizard(sr.Connection, sr));
}
}
示例2: GetTitle
private static String GetTitle(SrActionKind kind, SR sr)
{
switch (kind)
{
case SrActionKind.SetAsDefault:
return String.Format(Messages.ACTION_SR_SETTING_DEFAULT,
sr.Name, Helpers.GetName(sr.Connection));
case SrActionKind.Detach:
case SrActionKind.UnplugAndDestroyPBDs:
return String.Format(Messages.ACTION_SR_DETACHING,
sr.Name, Helpers.GetName(sr.Connection));
case SrActionKind.Destroy:
return String.Format(Messages.ACTION_SR_DESTROYING,
sr.Name, Helpers.GetName(sr.Connection));
case SrActionKind.Forget:
return String.Format(Messages.ACTION_SR_FORGETTING,
sr.Name, Helpers.GetName(sr.Connection));
case SrActionKind.UpgradeLVM:
return String.Format(Messages.ACTION_SR_CONVERT,
sr.Name, Helpers.GetName(sr.Connection));
case SrActionKind.ConvertToThin:
return String.Format(Messages.ACTION_SR_CONVERT_TO_THIN,
sr.NameWithLocation);
}
return "";
}
示例3: ImportVmAction
public ImportVmAction(IXenConnection connection, Host affinity, string filename, SR sr)
: base(connection, string.Format(Messages.IMPORTVM_TITLE, filename, Helpers.GetName(connection)), Messages.IMPORTVM_PREP)
{
Pool = Helpers.GetPoolOfOne(connection);
m_affinity = affinity;
Host = affinity ?? connection.Resolve(Pool.master);
SR = sr;
VM = null;
m_filename = filename;
#region RBAC Dependencies
ApiMethodsToRoleCheck.AddRange(ConstantRBACRequirements);
if (affinity != null)
ApiMethodsToRoleCheck.Add("vm.set_affinity");
//??
//if (startAutomatically)
// ApiMethodsToRoleCheck.Add("vm.start");
ApiMethodsToRoleCheck.AddRange(Role.CommonTaskApiList);
ApiMethodsToRoleCheck.AddRange(Role.CommonSessionApiList);
#endregion
}
示例4: SrProbeAction
/// <summary>
/// Won't appear in the program history (SuppressHistory == true).
/// </summary>
/// <param name="masterUuid">The UUID of the host from which to perform the probe (usually the pool master).</param>
/// <param name="srType">netapp or iscsi</param>
public SrProbeAction(IXenConnection connection, Host host, SR.SRTypes srType, Dictionary<String, String> dconf)
: base(connection, string.Format(Messages.ACTION_SCANNING_SR_FROM, Helpers.GetName(connection)), null, true)
{
this.host = host;
this.srType = srType;
this.dconf = dconf;
switch (srType) {
case XenAPI.SR.SRTypes.nfs:
Description = string.Format(Messages.ACTION_SR_SCANNING,
XenAPI.SR.getFriendlyTypeName(srType), dconf["server"]);
break;
case XenAPI.SR.SRTypes.lvmoiscsi:
Description = string.Format(Messages.ACTION_SR_SCANNING,
XenAPI.SR.getFriendlyTypeName(srType), dconf["target"]);
break;
case XenAPI.SR.SRTypes.lvmohba:
String device = dconf.ContainsKey(DEVICE) ?
dconf[DEVICE] : dconf[SCSIid];
Description = string.Format(Messages.ACTION_SR_SCANNING,
XenAPI.SR.getFriendlyTypeName(srType), device);
break;
default:
Description = string.Format(Messages.ACTION_SR_SCANNING,
XenAPI.SR.getFriendlyTypeName(srType), Messages.REPAIRSR_SERVER); // this is a bit minging: CA-22111
break;
}
smconf = new Dictionary<string, string>();
}
示例5: MissingSRProblem
public MissingSRProblem(Check check, Pool pool, SR sr, Dictionary<string, string> device_config)
: base(check)
{
this.pool = pool;
this.sr = sr;
this.device_config = device_config;
}
示例6: NewDiskDialog
public NewDiskDialog(IXenConnection connection, SR sr)
: this(connection, new List<VDI>())
{
TheSR = sr;
PickerUsage = SrPicker.SRPickerType.InstallFromTemplate;
SrListBox.SetAffinity(null);
SrListBox.selectSRorNone(TheSR);
}
示例7: CanExecute
private static bool CanExecute(SR sr)
{
return sr != null
&& sr.HasPBDs
&& !SR.IsDefaultSr(sr)
&& sr.SupportsVdiCreate()
&& (sr.shared || sr.Connection.Cache.HostCount <= 1)
&& !HelpersGUI.GetActionInProgress(sr);
}
示例8: GetLoader
private static SR GetLoader()
{
if (loader == null)
{
SR sr = new SR();
Interlocked.CompareExchange<SR>(ref loader, sr, null);
}
return loader;
}
示例9: ExecuteCore
protected override void ExecuteCore(SelectedItemCollection selection)
{
SR = GetFirstThickSRFromSelection(selection);
if (SR != null)
{
var dialog = new ConvertToThinSRDialog(this.SR.Connection, SR);
dialog.Show();
}
}
示例10: SrReattachAction
public SrReattachAction(SR sr,
String name, String description, Dictionary<String, String> dconf)
: base(sr.Connection,
string.Format(Messages.ACTION_SR_ATTACHING_TITLE, name, Helpers.GetName(sr.Connection)))
{
this.sr = sr;
this.name = name;
this.description = description;
this.dconf = dconf;
}
示例11: ImportImageAction
public ImportImageAction(IXenConnection connection, EnvelopeType ovfEnv, string directory, Dictionary<string, VmMapping> vmMappings, bool runfixups, SR selectedIsoSr,
string networkUuid, bool isTvmIpStatic, string tvmIpAddress, string tvmSubnetMask, string tvmGateway)
: base(connection, Messages.IMPORT_DISK_IMAGE, networkUuid, isTvmIpStatic, tvmIpAddress, tvmSubnetMask, tvmGateway)
{
m_ovfEnvelope = ovfEnv;
m_directory = directory;
m_vmMappings = vmMappings;
m_runfixups = runfixups;
m_selectedIsoSr = selectedIsoSr;
}
示例12: GetSRHAStatus
public static string GetSRHAStatus(SR sr)
{
Pool pool = Helpers.GetPoolOfOne(sr.Connection);
if (pool == null || pool.ha_statefiles.Length <= 0)
return String.Empty;
if (sr.VDIs.Contains(new XenRef<VDI>(pool.ha_statefiles[0])))
return Messages.HA_HEARTBEAT_SR;
return String.Empty;
}
示例13: GetLoader
private static SR GetLoader() {
if (loader == null) {
lock (InternalSyncObject) {
if (loader == null) {
loader = new SR();
}
}
}
return loader;
}
开发者ID:CaptainHayashi,项目名称:visualfsharp,代码行数:11,代码来源:Microsoft.VisualStudio.Package.LanguageService.cs
示例14: CanSelectSRInfo
private bool CanSelectSRInfo(SR.SRInfo info)
{
SR sr = SrWizardHelpers.SrInUse(info.UUID);
if (sr != null && sr.HasPBDs)
return false;
if (!String.IsNullOrEmpty(MustSelectUUID) && info.UUID != MustSelectUUID)
return false;
return true;
}
示例15: SrAction
public SrAction(SrActionKind kind, SR sr)
: base(sr.Connection, GetTitle(kind, sr))
{
this.kind = kind;
this.SR = sr;
Pool pool = Helpers.GetPoolOfOne(sr.Connection);
if (pool != null)
Pool = pool;
Host host = sr.GetStorageHost();
if (host != null)
Host = host;
}