public ActiveDirectorySchemaProperty FindDefunctProperty(string commonName)
 {
     base.CheckIfDisposed();
     if (commonName == null)
     {
         throw new ArgumentNullException("commonName");
     }
     if (commonName.Length == 0)
     {
         throw new ArgumentException(Res.GetString("EmptyStringParameter"), "commonName");
     }
     return(new ActiveDirectorySchemaProperty(base.context, commonName, ActiveDirectorySchemaProperty.GetPropertiesFromSchemaContainer(base.context, this.schemaEntry, commonName, true), this.schemaEntry));
 }
Esempio n. 2
0
        //
        // This method finds only among defunct properties
        //
        public ActiveDirectorySchemaProperty FindDefunctProperty(string commonName)
        {
            CheckIfDisposed();

            if (commonName == null)
            {
                throw new ArgumentNullException(nameof(commonName));
            }

            if (commonName.Length == 0)
            {
                throw new ArgumentException(SR.EmptyStringParameter, nameof(commonName));
            }

            // this will bind to the schema container and load the properties of this property
            // (will also check whether or not the property exists)
            SearchResult propertiesFromServer            = ActiveDirectorySchemaProperty.GetPropertiesFromSchemaContainer(context, _schemaEntry, commonName, true /* isDefunctOnServer */);
            ActiveDirectorySchemaProperty schemaProperty = new ActiveDirectorySchemaProperty(context, commonName, propertiesFromServer, _schemaEntry);

            return(schemaProperty);
        }
 public ActiveDirectorySchemaProperty FindDefunctProperty(string commonName)
 {
     base.CheckIfDisposed();
     if (commonName != null)
     {
         if (commonName.Length != 0)
         {
             SearchResult propertiesFromSchemaContainer = ActiveDirectorySchemaProperty.GetPropertiesFromSchemaContainer(this.context, this.schemaEntry, commonName, true);
             ActiveDirectorySchemaProperty activeDirectorySchemaProperty = new ActiveDirectorySchemaProperty(this.context, commonName, propertiesFromSchemaContainer, this.schemaEntry);
             return(activeDirectorySchemaProperty);
         }
         else
         {
             throw new ArgumentException(Res.GetString("EmptyStringParameter"), "commonName");
         }
     }
     else
     {
         throw new ArgumentNullException("commonName");
     }
 }