Example #1
0
        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.ConvertToThin:
                return(String.Format(Messages.ACTION_SR_CONVERT_TO_THIN,
                                     sr.NameWithLocation));
            }

            return("");
        }
Example #2
0
        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 "";
        }
Example #3
0
 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;
 }
Example #4
0
        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;
            }
        }
Example #5
0
 public SrAction(SrActionKind kind, SR sr, Dictionary <string, string> parameters)
     : this(kind, sr)
 {
     this.parameters = parameters;
 }
Example #6
0
 public SrAction(SrActionKind kind, SR sr, Dictionary<string, string> parameters)
     : this(kind, sr)
 {
     this.parameters = parameters;
 }
Example #7
0
        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:
                    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_UPGRADE,
                        sr.Name, Helpers.GetName(sr.Connection));
            }

            return "";
        }