Esempio n. 1
0
        private static string GetEnumValue(Value theValue)
        {
            string enumValue = string.Empty;
            EnumValue theEnumValue = theValue as EnumValue;
            if (theEnumValue != null)
            {
                enumValue = string.Format("{0} ({1})", theEnumValue.StringValue, theEnumValue.IntegerValue);
            }
            else
            {
                throw new InvalidDataException(string.Format("Unsupported type {0}", theValue.GetType()));
            }

            return enumValue;
        }
Esempio n. 2
0
        private static string GetIntegerValue(Value theValue)
        {
            string integerValue = string.Empty;
            BaseTypeValue theBaseTypeValue = theValue as BaseTypeValue;
            if (theBaseTypeValue != null)
            {
                integerValue = theBaseTypeValue.IsSigned ? theBaseTypeValue.SignedValue.ToString() : theBaseTypeValue.UnsignedValue.ToString();
            }
            else
            {
                throw new InvalidDataException(string.Format("Unsupported type {0}", theValue.GetType()));
            }

            return integerValue;
        }