public static OfflineAddressBookMapiProperty GetOABMapiProperty(uint mapiPropTag, OfflineAddressBookMapiPropertyOption option)
        {
            string value = string.Empty;

            if (Enum.IsDefined(typeof(PropTag), mapiPropTag))
            {
                value = ((PropTag)mapiPropTag).ToString();
            }
            if (string.IsNullOrEmpty(value) && Enum.IsDefined(typeof(CustomPropTag), mapiPropTag))
            {
                value = ((CustomPropTag)mapiPropTag).ToString();
            }
            int key = OfflineAddressBookMapiProperty.MapiIdFromPropTag(mapiPropTag);

            if (string.IsNullOrEmpty(value))
            {
                OfflineAddressBookMapiProperty.ReadSchema();
                if (OfflineAddressBookMapiProperty.mapiIdToSchemaAttr.ContainsKey(key))
                {
                    ADSchemaAttributeObject adschemaAttributeObject = OfflineAddressBookMapiProperty.mapiIdToSchemaAttr[key];
                    value = adschemaAttributeObject.LdapDisplayName;
                }
            }
            if (string.IsNullOrEmpty(value))
            {
                value = string.Format("0x{0:x8}", mapiPropTag);
            }
            return(new OfflineAddressBookMapiProperty(mapiPropTag, value, option));
        }
        internal void ResolveMapiPropTag()
        {
            if (this.mapiPropTag != 0U)
            {
                return;
            }
            int num = 0;

            if (int.TryParse(this.mapiPropName, NumberStyles.Integer, null, out num) || (CultureInfo.InvariantCulture.CompareInfo.IsPrefix(this.mapiPropName, "0x", CompareOptions.IgnoreCase) && int.TryParse(this.mapiPropName.Substring(2), NumberStyles.HexNumber, null, out num)))
            {
                OfflineAddressBookMapiProperty.ReadSchema();
                ADSchemaAttributeObject adschemaAttributeObject;
                int num2;
                int num3;
                if (num >= 1 && num <= 65534)
                {
                    if (!OfflineAddressBookMapiProperty.mapiIdToSchemaAttr.ContainsKey(num))
                    {
                        throw new ArgumentException(DirectoryStrings.UnableToResolveMapiIdException(num));
                    }
                    adschemaAttributeObject = OfflineAddressBookMapiProperty.mapiIdToSchemaAttr[num];
                    num2 = adschemaAttributeObject.MapiID;
                    num3 = OfflineAddressBookMapiProperty.MapiPropTypeFromSchemaSyntax(adschemaAttributeObject.OMSyntax, !adschemaAttributeObject.IsSingleValued);
                }
                else
                {
                    num2 = OfflineAddressBookMapiProperty.MapiIdFromPropTag((uint)num);
                    int num4 = num & 65535;
                    if (!OfflineAddressBookMapiProperty.mapiIdToSchemaAttr.ContainsKey(num2))
                    {
                        throw new ArgumentException(DirectoryStrings.UnableToResolveMapiIdException(num2));
                    }
                    adschemaAttributeObject = OfflineAddressBookMapiProperty.mapiIdToSchemaAttr[num2];
                    num3 = OfflineAddressBookMapiProperty.MapiPropTypeFromSchemaSyntax(adschemaAttributeObject.OMSyntax, !adschemaAttributeObject.IsSingleValued);
                    if (num3 != num4)
                    {
                        if ((num3 & 4096) != (num4 & 4096) || (((num3 & -4097) != 30 || (num4 & -4097) != 31) && ((num3 & -4097) != 31 || (num4 & -4097) != 30)))
                        {
                            throw new ArgumentException(DirectoryStrings.MismatchedMapiPropertyTypesException(num4, num3));
                        }
                        num3 = num4;
                    }
                }
                this.mapiPropTag  = (uint)(num3 | num2 << 16);
                this.mapiPropName = ((adschemaAttributeObject == null) ? string.Format("0x{0:x8}", this.mapiPropTag) : adschemaAttributeObject.LdapDisplayName);
            }
            if (this.mapiPropTag == 0U)
            {
                try
                {
                    this.mapiPropTag  = (uint)Enum.Parse(typeof(PropTag), this.mapiPropName, true);
                    this.mapiPropName = ((PropTag)this.mapiPropTag).ToString();
                }
                catch (ArgumentException)
                {
                }
            }
            if (this.mapiPropTag == 0U)
            {
                try
                {
                    this.mapiPropTag  = (uint)Enum.Parse(typeof(CustomPropTag), this.mapiPropName, true);
                    this.mapiPropName = ((CustomPropTag)this.mapiPropTag).ToString();
                }
                catch (ArgumentException)
                {
                }
            }
            if (this.mapiPropTag == 0U)
            {
                OfflineAddressBookMapiProperty.ReadSchema();
                if (OfflineAddressBookMapiProperty.schemaNameToSchemaAttr.ContainsKey(this.mapiPropName.ToLower()))
                {
                    ADSchemaAttributeObject adschemaAttributeObject2 = OfflineAddressBookMapiProperty.schemaNameToSchemaAttr[this.mapiPropName.ToLower()];
                    int num2 = adschemaAttributeObject2.MapiID;
                    int num3 = OfflineAddressBookMapiProperty.MapiPropTypeFromSchemaSyntax(adschemaAttributeObject2.OMSyntax, !adschemaAttributeObject2.IsSingleValued);
                    this.mapiPropTag  = (uint)(num3 | num2 << 16);
                    this.mapiPropName = adschemaAttributeObject2.Name;
                }
            }
            if (this.mapiPropTag == 0U && OfflineAddressBookMapiProperty.ldapDisplayNameToSchemaAttr.ContainsKey(this.mapiPropName.ToLower()))
            {
                ADSchemaAttributeObject adschemaAttributeObject3 = OfflineAddressBookMapiProperty.ldapDisplayNameToSchemaAttr[this.mapiPropName.ToLower()];
                int num2 = adschemaAttributeObject3.MapiID;
                int num3 = OfflineAddressBookMapiProperty.MapiPropTypeFromSchemaSyntax(adschemaAttributeObject3.OMSyntax, !adschemaAttributeObject3.IsSingleValued);
                this.mapiPropTag  = (uint)(num3 | num2 << 16);
                this.mapiPropName = adschemaAttributeObject3.LdapDisplayName;
            }
            if (this.mapiPropTag == 0U)
            {
                throw new ArgumentException(DirectoryStrings.UnableToResolveMapiPropertyNameException(this.mapiPropName));
            }
        }
        internal static object SyntaxGetter(IPropertyBag propertyBag)
        {
            string text = (string)propertyBag[ADSchemaAttributeSchema.RawAttributeSyntax];
            int    num  = (int)((AttributeSyntax)propertyBag[ADSchemaAttributeSchema.OMSyntax]);

            byte[]     values     = (byte[])propertyBag[ADSchemaAttributeSchema.OMObjectClass];
            DataSyntax dataSyntax = DataSyntax.UnDefined;
            string     key;

            switch (key = text)
            {
            case "2.5.5.0":
                dataSyntax = DataSyntax.UnDefined;
                break;

            case "2.5.5.1":
                dataSyntax = DataSyntax.DSDN;
                break;

            case "2.5.5.2":
                dataSyntax = DataSyntax.ObjectIdentifier;
                break;

            case "2.5.5.3":
                dataSyntax = DataSyntax.CaseSensitive;
                break;

            case "2.5.5.4":
                dataSyntax = DataSyntax.Teletex;
                break;

            case "2.5.5.5":
                if (num == 19)
                {
                    dataSyntax = DataSyntax.Printable;
                }
                else if (num == 22)
                {
                    dataSyntax = DataSyntax.IA5;
                }
                break;

            case "2.5.5.6":
                dataSyntax = DataSyntax.Numeric;
                break;

            case "2.5.5.7":
            {
                string y = ADSchemaAttributeObject.ToHexString(values);
                if (StringComparer.OrdinalIgnoreCase.Equals("2A864886F7140101010B", y))
                {
                    dataSyntax = DataSyntax.DNBinary;
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals("56060102050B1D", y))
                {
                    dataSyntax = DataSyntax.ORName;
                }
                break;
            }

            case "2.5.5.8":
                dataSyntax = DataSyntax.Boolean;
                break;

            case "2.5.5.9":
                if (num == 2)
                {
                    dataSyntax = DataSyntax.Integer;
                }
                else if (num == 10)
                {
                    dataSyntax = DataSyntax.Enumeration;
                }
                break;

            case "2.5.5.10":
                if (num == 4)
                {
                    dataSyntax = DataSyntax.Octet;
                }
                else if (num == 127)
                {
                    dataSyntax = DataSyntax.ReplicaLink;
                }
                break;

            case "2.5.5.11":
                if (num == 23)
                {
                    dataSyntax = DataSyntax.UTCTime;
                }
                else if (num == 24)
                {
                    dataSyntax = DataSyntax.GeneralizedTime;
                }
                break;

            case "2.5.5.12":
                dataSyntax = DataSyntax.Unicode;
                break;

            case "2.5.5.13":
                dataSyntax = DataSyntax.PresentationAddress;
                break;

            case "2.5.5.14":
            {
                string y = ADSchemaAttributeObject.ToHexString(values);
                if (StringComparer.OrdinalIgnoreCase.Equals("2B0C0287731C00853E", y))
                {
                    dataSyntax = DataSyntax.AccessPoint;
                }
                else if (StringComparer.OrdinalIgnoreCase.Equals("2A864886F7140101010C", y))
                {
                    dataSyntax = DataSyntax.DNString;
                }
                break;
            }

            case "2.5.5.15":
                dataSyntax = DataSyntax.NTSecDesc;
                break;

            case "2.5.5.16":
                dataSyntax = DataSyntax.LargeInteger;
                break;

            case "2.5.5.17":
                dataSyntax = DataSyntax.Sid;
                break;
            }
            return(dataSyntax);
        }