コード例 #1
0
        public static SharedConfigurationInfo Parse(string strValue)
        {
            SharedConfigurationInfo result;

            if (!SharedConfigurationInfo.TryParse(strValue, out result))
            {
                throw new ArgumentException("strValue: " + strValue);
            }
            return(result);
        }
コード例 #2
0
        public static bool TryParse(string strValue, out SharedConfigurationInfo sharedConfigInfo)
        {
            sharedConfigInfo = null;
            if (string.IsNullOrEmpty(strValue))
            {
                return(false);
            }
            string[] array = strValue.Split(new string[]
            {
                "-"
            }, StringSplitOptions.RemoveEmptyEntries);
            if (array == null || array.Length < 3)
            {
                return(false);
            }
            int i = 0;

            string[] array2 = array[i].Split(new string[]
            {
                "_"
            }, StringSplitOptions.RemoveEmptyEntries);
            if (array2 == null || array2.Length < 4)
            {
                return(false);
            }
            ServerVersion serverVersion = new ServerVersion(int.Parse(array2[0]), int.Parse(array2[1]), int.Parse(array2[2]), int.Parse(array2[3]));

            i++;
            if (string.IsNullOrEmpty(array[i]) || string.IsNullOrEmpty(array[i + 1]))
            {
                return(false);
            }
            string text  = array[i];
            string text2 = array[i + 1];

            i += 2;
            sharedConfigInfo = new SharedConfigurationInfo(serverVersion, text, text2);
            string text3 = null;

            while (i < array.Length)
            {
                text3 = string.Join("-", new string[]
                {
                    text3,
                    array[i]
                });
                i++;
            }
            sharedConfigInfo.extension = text3;
            return(true);
        }
コード例 #3
0
        public override bool Equals(object comparand)
        {
            SharedConfigurationInfo sharedConfigurationInfo = comparand as SharedConfigurationInfo;

            return(sharedConfigurationInfo != null && this.Equals(sharedConfigurationInfo));
        }
コード例 #4
0
 public bool Equals(SharedConfigurationInfo value)
 {
     return(object.ReferenceEquals(this, value) || (value != null && this.currentVersion.Equals(value.currentVersion) && this.programId.Equals(value.programId, StringComparison.OrdinalIgnoreCase) && this.offerId.Equals(value.offerId, StringComparison.OrdinalIgnoreCase)));
 }