Esempio n. 1
0
        /// <summary>
        /// Creates a custom value for DiskSkuTypes.
        /// </summary>
        /// <param name="value">the custom value</param>
        public DiskSkuTypes(DiskStorageAccountTypes value)
        {
            if (ValuesByName == null)
            {
                ValuesByName = new Dictionary <string, DiskSkuTypes>();
            }

            ValuesByName[value.ToString().ToLower()] = this;
            this.value = value;
        }
Esempio n. 2
0
        /// <summary>
        /// Parses a disk SKU type from a storage account type.
        /// </summary>
        /// <param name="value">a storage account type</param>
        /// <returns>a disk SKU type</returns>
        public static DiskSkuTypes FromStorageAccountType(DiskStorageAccountTypes value)
        {
            DiskSkuTypes result;

            if (ValuesByName == null)
            {
                return(new DiskSkuTypes(value));
            }
            else if (ValuesByName.TryGetValue(value.ToString().ToLower(), out result))
            {
                return(result);
            }
            else
            {
                return(new DiskSkuTypes(value));
            }
        }