internal ActiveDirectorySchemaProperty(DirectoryContext context, string ldapDisplayName, DirectoryEntry propertyEntry, DirectoryEntry schemaEntry)
 {
     this.syntax            = ~ActiveDirectorySyntax.CaseExactString;
     this.rangeLower        = null;
     this.rangeUpper        = null;
     this.linkId            = null;
     this.context           = context;
     this.ldapDisplayName   = ldapDisplayName;
     this.propertyEntry     = propertyEntry;
     this.isDefunctOnServer = false;
     this.isDefunct         = this.isDefunctOnServer;
     try
     {
         this.abstractPropertyEntry = DirectoryEntryManager.GetDirectoryEntryInternal(context, "LDAP://" + context.GetServerName() + "/schema/" + ldapDisplayName);
         this.iadsProperty          = (NativeComInterfaces.IAdsProperty) this.abstractPropertyEntry.NativeObject;
     }
     catch (COMException exception)
     {
         if (exception.ErrorCode == -2147463168)
         {
             throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
         }
         throw ExceptionHelper.GetExceptionFromCOMException(context, exception);
     }
     catch (InvalidCastException)
     {
         throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
     }
     catch (ActiveDirectoryObjectNotFoundException)
     {
         throw new ActiveDirectoryOperationException(Res.GetString("ADAMInstanceNotFoundInConfigSet", new object[] { context.Name }));
     }
     this.isBound = true;
 }
 internal ActiveDirectorySchemaProperty(DirectoryContext context, string ldapDisplayName, DirectoryEntry propertyEntry, DirectoryEntry schemaEntry)
 {
     this.syntax = ~ActiveDirectorySyntax.CaseExactString;
     this.rangeLower = null;
     this.rangeUpper = null;
     this.linkId = null;
     this.context = context;
     this.ldapDisplayName = ldapDisplayName;
     this.propertyEntry = propertyEntry;
     this.isDefunctOnServer = false;
     this.isDefunct = this.isDefunctOnServer;
     try
     {
         this.abstractPropertyEntry = DirectoryEntryManager.GetDirectoryEntryInternal(context, "LDAP://" + context.GetServerName() + "/schema/" + ldapDisplayName);
         this.iadsProperty = (NativeComInterfaces.IAdsProperty) this.abstractPropertyEntry.NativeObject;
     }
     catch (COMException exception)
     {
         if (exception.ErrorCode == -2147463168)
         {
             throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
         }
         throw ExceptionHelper.GetExceptionFromCOMException(context, exception);
     }
     catch (InvalidCastException)
     {
         throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
     }
     catch (ActiveDirectoryObjectNotFoundException)
     {
         throw new ActiveDirectoryOperationException(Res.GetString("ADAMInstanceNotFoundInConfigSet", new object[] { context.Name }));
     }
     this.isBound = true;
 }
		internal ActiveDirectorySchemaProperty(DirectoryContext context, string ldapDisplayName, DirectoryEntry propertyEntry, DirectoryEntry schemaEntry)
		{
			this.syntax = ActiveDirectorySyntax.CaseIgnoreString | ActiveDirectorySyntax.NumericString | ActiveDirectorySyntax.DirectoryString | ActiveDirectorySyntax.OctetString | ActiveDirectorySyntax.SecurityDescriptor | ActiveDirectorySyntax.Int | ActiveDirectorySyntax.Int64 | ActiveDirectorySyntax.Bool | ActiveDirectorySyntax.Oid | ActiveDirectorySyntax.GeneralizedTime | ActiveDirectorySyntax.UtcTime | ActiveDirectorySyntax.DN | ActiveDirectorySyntax.DNWithBinary | ActiveDirectorySyntax.DNWithString | ActiveDirectorySyntax.Enumeration | ActiveDirectorySyntax.IA5String | ActiveDirectorySyntax.PrintableString | ActiveDirectorySyntax.Sid | ActiveDirectorySyntax.AccessPointDN | ActiveDirectorySyntax.ORName | ActiveDirectorySyntax.PresentationAddress | ActiveDirectorySyntax.ReplicaLink;
			this.rangeLower = null;
			this.rangeUpper = null;
			this.linkId = null;
			this.context = context;
			this.ldapDisplayName = ldapDisplayName;
			this.propertyEntry = propertyEntry;
			this.isDefunctOnServer = false;
			this.isDefunct = this.isDefunctOnServer;
			try
			{
				this.abstractPropertyEntry = DirectoryEntryManager.GetDirectoryEntryInternal(context, string.Concat("LDAP://", context.GetServerName(), "/schema/", ldapDisplayName));
				this.iadsProperty = (NativeComInterfaces.IAdsProperty)this.abstractPropertyEntry.NativeObject;
			}
			catch (COMException cOMException1)
			{
				COMException cOMException = cOMException1;
				if (cOMException.ErrorCode != -2147463168)
				{
					throw ExceptionHelper.GetExceptionFromCOMException(context, cOMException);
				}
				else
				{
					throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
				}
			}
			catch (InvalidCastException invalidCastException)
			{
				throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
			}
			catch (ActiveDirectoryObjectNotFoundException activeDirectoryObjectNotFoundException)
			{
				object[] name = new object[1];
				name[0] = context.Name;
				throw new ActiveDirectoryOperationException(Res.GetString("ADAMInstanceNotFoundInConfigSet", name));
			}
			this.isBound = true;
		}
        // internal constructor
        internal ActiveDirectorySchemaProperty(DirectoryContext context, string ldapDisplayName, DirectoryEntry propertyEntry, DirectoryEntry schemaEntry)
        {
            _context = context;
            _ldapDisplayName = ldapDisplayName;

            // common name of the property defaults to the ldap display name
            _propertyEntry = propertyEntry;
            _isDefunctOnServer = false;
            _isDefunct = _isDefunctOnServer;

            try
            {
                // initialize the directory entry for the abstract schema class
                _abstractPropertyEntry = DirectoryEntryManager.GetDirectoryEntryInternal(context, "LDAP://" + context.GetServerName() + "/schema/" + ldapDisplayName);
                _iadsProperty = (NativeComInterfaces.IAdsProperty)_abstractPropertyEntry.NativeObject;
            }
            catch (COMException e)
            {
                if (e.ErrorCode == unchecked((int)0x80005000))
                {
                    throw new ActiveDirectoryObjectNotFoundException(Res.GetString(Res.DSNotFound), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
                }
                else
                {
                    throw ExceptionHelper.GetExceptionFromCOMException(context, e);
                }
            }
            catch (InvalidCastException)
            {
                // this means that we found an object but it is not a schema class
                throw new ActiveDirectoryObjectNotFoundException(Res.GetString(Res.DSNotFound), typeof(ActiveDirectorySchemaProperty), ldapDisplayName);
            }
            catch (ActiveDirectoryObjectNotFoundException)
            {
                // this is the case where the context is a config set and we could not find an ADAM instance in that config set
                throw new ActiveDirectoryOperationException(Res.GetString(Res.ADAMInstanceNotFoundInConfigSet, context.Name));
            }

            // set the bind flag
            this.isBound = true;
        }