public static DirectoryEntry NewItem(DirectoryEntry parent, string name, string classNamePrefix) { PscxArgumentException.ThrowIfIsNull(parent, "parent"); DirectoryEntryType entryType = FindByPrefix(classNamePrefix); if (entryType == null) { return(null); } return(entryType.NewItem(parent, name)); }
static DirectoryEntryType() { _classes = new Dictionary<String, DirectoryEntryType>(StringComparer.OrdinalIgnoreCase); BuiltinDomain = RegisterContainer("builtinDomain"); Computer = Register("computer"); Contact = Register("contact"); Container = RegisterContainer("container"); DomainDns = RegisterContainer("domainDNS"); Group = Register(new ActiveDirectory.GroupClass()); InetOrgPerson = Register("inetOrgPerson"); LostAndFound = RegisterContainer("lostAndFound"); MsExchSystemObjectsContainer = RegisterContainer("msExchSystemObjectsContainer"); MsmqRecipient = Register("msMQ-Custom-Recipient"); OrganizationalUnit = Register(new ActiveDirectory.OrganizationalUnitClass()); Printer = Register("printQueue"); User = Register(new ActiveDirectory.UserClass()); Volume = Register("volume"); }
protected static DirectoryEntryType Register(DirectoryEntryType entryClass) { return _classes[entryClass._className] = entryClass; }
protected static DirectoryEntryType Register(DirectoryEntryType entryClass) { return(_classes[entryClass._className] = entryClass); }