Пример #1
0
        public static PropertyValue Parse(XElement element)
        {
            string            value = element.Attribute("Kind").Value;
            RegistryValueKind registryValueKind;

            if (!Enum.TryParse <RegistryValueKind>(value, true, out registryValueKind))
            {
                registryValueKind = RegistryValueKind.Unknown;
            }
            string            value2             = element.Value;
            RegistryValueKind registryValueKind2 = registryValueKind;
            object            value3;

            switch (registryValueKind2)
            {
            case RegistryValueKind.String:
                value3 = value2;
                goto IL_93;

            case RegistryValueKind.ExpandString:
            case (RegistryValueKind)5:
            case (RegistryValueKind)6:
                break;

            case RegistryValueKind.Binary:
                value3 = SoapHexBinary.Parse(value2).Value;
                goto IL_93;

            case RegistryValueKind.DWord:
                value3 = int.Parse(value2);
                goto IL_93;

            case RegistryValueKind.MultiString:
                value3 = Utils.GetMultistring(element);
                goto IL_93;

            default:
                if (registryValueKind2 == RegistryValueKind.QWord)
                {
                    value3 = long.Parse(value2);
                    goto IL_93;
                }
                break;
            }
            value3 = value2;
IL_93:
            return(new PropertyValue(value3, registryValueKind));
        }