public LdapSchema(LdapEntry ent)
: base(ent.DN, ent.getAttributeSet())
{
InitBlock();
//reset all definitions
for (int i = 0; i < schemaTypeNames.Length; i++)
{
idTable[i] = new System.Collections.Hashtable();
nameTable[i] = new System.Collections.Hashtable();
}
System.Collections.IEnumerator itr = base.getAttributeSet().GetEnumerator();
while (itr.MoveNext())
{
LdapAttribute attr = (LdapAttribute) itr.Current;
System.String value_Renamed, attrName = attr.Name;
System.Collections.IEnumerator enumString = attr.StringValues;
if (attrName.ToUpper().Equals(schemaTypeNames[OBJECT_CLASS].ToUpper()))
{
LdapObjectClassSchema classSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
try
{
classSchema = new LdapObjectClassSchema(value_Renamed);
}
catch (System.Exception e)
{
continue; //Error parsing: do not add this definition
}
addElement(OBJECT_CLASS, classSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[ATTRIBUTE].ToUpper()))
{
LdapAttributeSchema attrSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
try
{
attrSchema = new LdapAttributeSchema(value_Renamed);
}
catch (System.Exception e)
{
continue; //Error parsing: do not add this definition
}
addElement(ATTRIBUTE, attrSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[SYNTAX].ToUpper()))
{
LdapSyntaxSchema syntaxSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
syntaxSchema = new LdapSyntaxSchema(value_Renamed);
addElement(SYNTAX, syntaxSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[MATCHING].ToUpper()))
{
LdapMatchingRuleSchema matchingRuleSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
matchingRuleSchema = new LdapMatchingRuleSchema(value_Renamed, null);
addElement(MATCHING, matchingRuleSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[MATCHING_USE].ToUpper()))
{
LdapMatchingRuleUseSchema matchingRuleUseSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
matchingRuleUseSchema = new LdapMatchingRuleUseSchema(value_Renamed);
addElement(MATCHING_USE, matchingRuleUseSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[DITCONTENT].ToUpper()))
{
LdapDITContentRuleSchema dITContentRuleSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
dITContentRuleSchema = new LdapDITContentRuleSchema(value_Renamed);
addElement(DITCONTENT, dITContentRuleSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[DITSTRUCTURE].ToUpper()))
{
LdapDITStructureRuleSchema dITStructureRuleSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
dITStructureRuleSchema = new LdapDITStructureRuleSchema(value_Renamed);
addElement(DITSTRUCTURE, dITStructureRuleSchema);
}
}
else if (attrName.ToUpper().Equals(schemaTypeNames[NAME_FORM].ToUpper()))
{
LdapNameFormSchema nameFormSchema;
while (enumString.MoveNext())
{
value_Renamed = ((System.String) enumString.Current);
nameFormSchema = new LdapNameFormSchema(value_Renamed);
addElement(NAME_FORM, nameFormSchema);
}
}
//All non schema attributes are ignored.
continue;
}
}