public ActiveDirectorySchemaClass(DirectoryContext context, string ldapDisplayName) { this.type = SchemaClassType.Structural; if (context == null) { throw new ArgumentNullException("context"); } if ((context.Name == null) && !context.isRootDomain()) { throw new ArgumentException(Res.GetString("ContextNotAssociatedWithDomain"), "context"); } if (((context.Name != null) && !context.isRootDomain()) && (!context.isADAMConfigSet() && !context.isServer())) { throw new ArgumentException(Res.GetString("NotADOrADAM"), "context"); } if (ldapDisplayName == null) { throw new ArgumentNullException("ldapDisplayName"); } if (ldapDisplayName.Length == 0) { throw new ArgumentException(Res.GetString("EmptyStringParameter"), "ldapDisplayName"); } this.context = new DirectoryContext(context); this.schemaEntry = DirectoryEntryManager.GetDirectoryEntry(context, WellKnownDN.SchemaNamingContext); this.schemaEntry.Bind(true); this.ldapDisplayName = ldapDisplayName; this.commonName = ldapDisplayName; this.isBound = false; }
internal ActiveDirectorySchemaClass(DirectoryContext context, string ldapDisplayName, DirectoryEntry classEntry, DirectoryEntry schemaEntry) { this.type = SchemaClassType.Structural; this.context = context; this.ldapDisplayName = ldapDisplayName; this.classEntry = classEntry; this.schemaEntry = schemaEntry; this.isDefunctOnServer = false; this.isDefunct = this.isDefunctOnServer; try { this.abstractClassEntry = DirectoryEntryManager.GetDirectoryEntryInternal(context, "LDAP://" + context.GetServerName() + "/schema/" + ldapDisplayName); this.iadsClass = (NativeComInterfaces.IAdsClass) this.abstractClassEntry.NativeObject; } catch (COMException exception) { if (exception.ErrorCode == -2147463168) { throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaClass), ldapDisplayName); } throw ExceptionHelper.GetExceptionFromCOMException(context, exception); } catch (InvalidCastException) { throw new ActiveDirectoryObjectNotFoundException(Res.GetString("DSNotFound"), typeof(ActiveDirectorySchemaClass), ldapDisplayName); } catch (ActiveDirectoryObjectNotFoundException) { throw new ActiveDirectoryOperationException(Res.GetString("ADAMInstanceNotFoundInConfigSet", new object[] { context.Name })); } this.isBound = true; }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { base.CheckIfDisposed(); if ((type < SchemaClassType.Type88) || (type > SchemaClassType.Auxiliary)) { throw new InvalidEnumArgumentException("type", (int) type, typeof(SchemaClassType)); } string filter = string.Concat(new object[] { "(&(", PropertyManager.ObjectCategory, "=classSchema)(", PropertyManager.ObjectClassCategory, "=", (int) type, ")(!(", PropertyManager.IsDefunct, "=TRUE)))" }); return GetAllClasses(base.context, this.schemaEntry, filter); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { base.CheckIfDisposed(); if ((type < SchemaClassType.Type88) || (type > SchemaClassType.Auxiliary)) { throw new InvalidEnumArgumentException("type", (int)type, typeof(SchemaClassType)); } string filter = string.Concat(new object[] { "(&(", PropertyManager.ObjectCategory, "=classSchema)(", PropertyManager.ObjectClassCategory, "=", (int)type, ")(!(", PropertyManager.IsDefunct, "=TRUE)))" }); return(GetAllClasses(base.context, this.schemaEntry, filter)); }
internal ActiveDirectorySchemaClass(DirectoryContext context, string commonName, string ldapDisplayName, DirectoryEntry classEntry, DirectoryEntry schemaEntry) { this.type = SchemaClassType.Structural; this.context = context; this.schemaEntry = schemaEntry; this.classEntry = classEntry; this.commonName = commonName; this.ldapDisplayName = ldapDisplayName; this.isDefunctOnServer = true; this.isDefunct = this.isDefunctOnServer; this.isBound = true; }
internal ActiveDirectorySchemaClass(DirectoryContext context, string commonName, Hashtable propertyValuesFromServer, DirectoryEntry schemaEntry) { this.type = SchemaClassType.Structural; this.context = context; this.schemaEntry = schemaEntry; this.propertyValuesFromServer = propertyValuesFromServer; this.propertiesFromSchemaContainerInitialized = true; this.classEntry = this.GetSchemaClassDirectoryEntry(); this.commonName = commonName; this.ldapDisplayName = (string) this.GetValueFromCache(PropertyManager.LdapDisplayName, true); this.isDefunctOnServer = true; this.isDefunct = this.isDefunctOnServer; this.isBound = true; }
internal ActiveDirectorySchemaClass(DirectoryContext context, string commonName, Hashtable propertyValuesFromServer, DirectoryEntry schemaEntry) { this.type = SchemaClassType.Structural; this.context = context; this.schemaEntry = schemaEntry; this.propertyValuesFromServer = propertyValuesFromServer; this.propertiesFromSchemaContainerInitialized = true; this.classEntry = this.GetSchemaClassDirectoryEntry(); this.commonName = commonName; this.ldapDisplayName = (string)this.GetValueFromCache(PropertyManager.LdapDisplayName, true); this.isDefunctOnServer = true; this.isDefunct = this.isDefunctOnServer; this.isBound = true; }
// // This method returns only non-defunct classes of the specified type // public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { CheckIfDisposed(); // validate the type if (type < SchemaClassType.Type88 || type > SchemaClassType.Auxiliary) { throw new InvalidEnumArgumentException(nameof(type), (int)type, typeof(SchemaClassType)); } string filter = "(&(" + PropertyManager.ObjectCategory + "=classSchema)" + "(" + PropertyManager.ObjectClassCategory + "=" + (int)type + ")" + "(!(" + PropertyManager.IsDefunct + "=TRUE)))"; return(GetAllClasses(context, _schemaEntry, filter)); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { base.CheckIfDisposed(); if (type < SchemaClassType.Type88 || type > SchemaClassType.Auxiliary) { throw new InvalidEnumArgumentException("type", (int)type, typeof(SchemaClassType)); } else { object[] objectCategory = new object[9]; objectCategory[0] = "(&("; objectCategory[1] = PropertyManager.ObjectCategory; objectCategory[2] = "=classSchema)("; objectCategory[3] = PropertyManager.ObjectClassCategory; objectCategory[4] = "="; objectCategory[5] = (int)type; objectCategory[6] = ")(!("; objectCategory[7] = PropertyManager.IsDefunct; objectCategory[8] = "=TRUE)))"; string str = string.Concat(objectCategory); return(ActiveDirectorySchema.GetAllClasses(this.context, this.schemaEntry, str)); } }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { Contract.Ensures(Contract.Result<ReadOnlyActiveDirectorySchemaClassCollection>() != null); return default(ReadOnlyActiveDirectorySchemaClassCollection); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { Contract.Ensures(Contract.Result <ReadOnlyActiveDirectorySchemaClassCollection>() != null); return(default(ReadOnlyActiveDirectorySchemaClassCollection)); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses (SchemaClassType type) { throw new NotImplementedException (); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { throw new NotImplementedException(); }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { }
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) {}
public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { base.CheckIfDisposed(); if (type < SchemaClassType.Type88 || type > SchemaClassType.Auxiliary) { throw new InvalidEnumArgumentException("type", (int)type, typeof(SchemaClassType)); } else { object[] objectCategory = new object[9]; objectCategory[0] = "(&("; objectCategory[1] = PropertyManager.ObjectCategory; objectCategory[2] = "=classSchema)("; objectCategory[3] = PropertyManager.ObjectClassCategory; objectCategory[4] = "="; objectCategory[5] = (int)type; objectCategory[6] = ")(!("; objectCategory[7] = PropertyManager.IsDefunct; objectCategory[8] = "=TRUE)))"; string str = string.Concat(objectCategory); return ActiveDirectorySchema.GetAllClasses(this.context, this.schemaEntry, str); } }
// // This method returns only non-defunct classes of the specified type // public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses(SchemaClassType type) { CheckIfDisposed(); // validate the type if (type < SchemaClassType.Type88 || type > SchemaClassType.Auxiliary) { throw new InvalidEnumArgumentException("type", (int)type, typeof(SchemaClassType)); } string filter = "(&(" + PropertyManager.ObjectCategory + "=classSchema)" + "(" + PropertyManager.ObjectClassCategory + "=" + (int)type + ")" + "(!(" + PropertyManager.IsDefunct + "=TRUE)))"; return GetAllClasses(context, _schemaEntry, filter); }