当前位置: 首页>>代码示例>>C#>>正文


C# SR类代码示例

本文整理汇总了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));
     }
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:ReattachSRCommand.cs

示例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 "";
        }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:32,代码来源:SrAction.cs

示例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
		}
开发者ID:slamj1,项目名称:xenadmin,代码行数:26,代码来源:ImportVmAction.cs

示例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>();
        }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:34,代码来源:SrProbeAction.cs

示例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;
 }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:7,代码来源:MissingSRProblem.cs

示例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);
 }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:8,代码来源:NewDiskDialog.cs

示例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);
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:9,代码来源:SetAsDefaultSRCommand.cs

示例8: GetLoader

 private static SR GetLoader()
 {
     if (loader == null)
     {
         SR sr = new SR();
         Interlocked.CompareExchange<SR>(ref loader, sr, null);
     }
     return loader;
 }
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:9,代码来源:SR.cs

示例9: ExecuteCore

        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            SR = GetFirstThickSRFromSelection(selection);

            if (SR != null)
            {
                var dialog = new ConvertToThinSRDialog(this.SR.Connection, SR);
                dialog.Show();
            }
        }
开发者ID:slamj1,项目名称:xenadmin,代码行数:10,代码来源:ConvertToThinSRCommand.cs

示例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;
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:10,代码来源:SrReattachAction.cs

示例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;
		}
开发者ID:ReSalles,项目名称:xenadmin,代码行数:10,代码来源:ImportImageAction.cs

示例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;
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:11,代码来源:PropertyAccessorHelper.cs

示例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;
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:12,代码来源:SRListBox.cs

示例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;
 }
开发者ID:ktz666,项目名称:xenadmin,代码行数:12,代码来源:SrAction.cs


注:本文中的SR类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。