SearchResult SelectResult(ModelObject obj, bool typesOnly, Sequence <string> selection) { Set <string> includedAttributes; if (selection.Count == 0) { includedAttributes = new Set <string>(obj.attributes.Keys); } else if (selection.Count == 1 && selection[0] == "1.1") { includedAttributes = new Set <string>(); } else { includedAttributes = new Set <string>(); foreach (string sel in selection) { if (sel == "*") { includedAttributes = includedAttributes.Union(new Set <string>(obj.attributes.Keys)); } else { includedAttributes = includedAttributes.Add(sel.ToLower().Trim()); } } } MapContainer <string, string> map = new MapContainer <string, string>(); foreach (string attr in obj.attributes.Keys) { if (includedAttributes.Contains(attr)) { if (typesOnly) { map[attr] = null; } else { map[attr] = obj.attributes[attr].ToString(); } } } return(new SearchResult((string)obj[StandardNames.distinguishedName], map.ToMap())); }