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)); }