internal Record MakeRecord(object obj, bool addCacheHelper, long recID) { Dictionary <long, string> dictionary = null; DirectoryEntry item = obj as DirectoryEntry; SearchResult relItem = obj as SearchResult; if (obj == null) { return(null); } if (this.props == null) { this.props = new RecordPropertyCollection(this); } if (relItem != null) { item = relItem.GetDirectoryEntry(); foreach (string str in relItem.Properties.PropertyNames) { if (this.props.GetPropertyByName(str) == null) { this.props.Props.Add(new RecordProperty(this, str, null)); } } } if (item != null) { if (addCacheHelper) { if ((dictionary == null) && (!cacheHelpers.TryGetValue(this.ContextID, out dictionary) || (dictionary == null))) { cacheHelpers[this.ContextID] = dictionary = new Dictionary <long, string>(); } dictionary[recID] = item.Path; } this.disposables.Add(item); foreach (string str2 in item.Properties.PropertyNames) { if (this.props.GetPropertyByName(str2) == null) { this.props.Props.Add(new RecordProperty(this, str2, null)); } } } return(new Record(this, item, relItem, Guid.Empty, recID)); }
public Ado() { this.props = new RecordPropertyCollection(this); }