1 /******************************************************************************
3 * Copyright (c) 2003 Novell Inc., www.novell.com
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the Software), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 *******************************************************************************/
25 // System.DirectoryServices.ResultPropertyCollection .cs
28 // Sunil Kumar (sunilk@novell.com)
34 using System.Collections;
36 namespace System.DirectoryServices
39 /// Contains the properties of a SearchResult instance.
41 /// For a list of all members of this type, see ResultPropertyCollection
45 /// SearchResult instances are similar to DirectoryEntry instances. The
46 /// notable difference is that the DirectoryEntry retrieves its
47 /// information from the Active Directory hierarchy each time a new object
48 /// is accessed, whereas the data for the SearchResult is already
49 /// available in the SearchResultCollection that a DirectorySearcher
50 /// query returns. If you try to get a SearchResult property that your
51 /// query did not specify for retrieval, the property will not be
54 public class ResultPropertyCollection : DictionaryBase
56 internal ResultPropertyCollection()
61 public ResultPropertyValueCollection this[string name]
64 return (ResultPropertyValueCollection) this.Dictionary[name.ToLower()];
66 // set { this.Dictionary[key] = value; }
68 //add a ResultPropertyValueCollection based on key
69 internal void Add(string key, ResultPropertyValueCollection rpcoll)
71 this.Dictionary.Add(key.ToLower(), rpcoll);
74 //see if collection contains an entry corresponding to key
75 public bool Contains(string propertyName)
77 return this.Dictionary.Contains(propertyName.ToLower());
80 public ICollection PropertyNames
84 return this.Dictionary.Keys;
88 public ICollection Values
92 return this.Dictionary.Values;
96 public void CopyTo (ResultPropertyValueCollection[] array, int index)
98 foreach (ResultPropertyValueCollection vals in Values)
99 array[index++] = vals;