2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.DirectoryServices / System.DirectoryServices / ResultPropertyCollection.cs
blob2c7460276fdf710a212eb49aeb1692b250ae12d1
1 /******************************************************************************
2 * The MIT License
3 * Copyright (c) 2003 Novell Inc., www.novell.com
4 *
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
21 * SOFTWARE.
22 *******************************************************************************/
25 // System.DirectoryServices.ResultPropertyCollection .cs
27 // Author:
28 // Sunil Kumar (sunilk@novell.com)
30 // (C) Novell Inc.
33 using System;
34 using System.Collections;
36 namespace System.DirectoryServices
38 /// <summary>
39 /// Contains the properties of a SearchResult instance.
40 ///
41 /// For a list of all members of this type, see ResultPropertyCollection
42 /// Members.
43 /// </summary>
44 /// <remarks>
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
52 /// available.
53 /// </remarks>
54 public class ResultPropertyCollection : DictionaryBase
56 internal ResultPropertyCollection()
61 public ResultPropertyValueCollection this[string key]
63 get {
64 return (ResultPropertyValueCollection) this.Dictionary[key.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 key)
77 return this.Dictionary.Contains(key.ToLower());
80 public ICollection PropertyNames
82 get
84 return this.Dictionary.Keys;
88 public ICollection Values
90 get
92 return this.Dictionary.Values;
96 public void CopyTo (ResultPropertyValueCollection[] copy_to, int index)
98 foreach (ResultPropertyValueCollection vals in Values)
99 copy_to[index++] = vals;