Class files Implementing System.DirectoryServices namespace
[mono.git] / mcs / class / System.DirectoryServices / System.DirectoryServices / ResultPropertyCollection.cs
1 /******************************************************************************\r
2 * The MIT License\r
3 * Copyright (c) 2003 Novell Inc.,  www.novell.com\r
4\r
5 * Permission is hereby granted, free of charge, to any person obtaining  a copy\r
6 * of this software and associated documentation files (the Software), to deal\r
7 * in the Software without restriction, including  without limitation the rights\r
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \r
9 * copies of the Software, and to  permit persons to whom the Software is \r
10 * furnished to do so, subject to the following conditions:\r
11\r
12 * The above copyright notice and this permission notice shall be included in \r
13 * all copies or substantial portions of the Software.\r
14\r
15 * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
21 * SOFTWARE.\r
22 *******************************************************************************/\r
23 \r
24 //\r
25 // System.DirectoryServices.ResultPropertyCollection .cs\r
26 //\r
27 // Author:\r
28 //   Sunil Kumar (sunilk@novell.com)\r
29 //\r
30 // (C)  Novell Inc.\r
31 //\r
32 \r
33 using System;\r
34 using System.Collections;\r
35 \r
36 namespace System.DirectoryServices\r
37 {\r
38         /// <summary>\r
39         /// Contains the properties of a SearchResult instance. \r
40         /// \r
41         /// For a list of all members of this type, see ResultPropertyCollection \r
42         /// Members.\r
43         /// </summary>\r
44         /// <remarks>\r
45         /// SearchResult instances are similar to DirectoryEntry instances. The \r
46         /// notable difference is that the DirectoryEntry retrieves its \r
47         /// information from the Active Directory hierarchy each time a new object \r
48         /// is accessed, whereas the data for the SearchResult is already \r
49         /// available in the SearchResultCollection that a DirectorySearcher \r
50         /// query returns. If you try to get a SearchResult property that your \r
51         /// query did not specify for retrieval, the property will not be \r
52         /// available.\r
53         /// </remarks>\r
54         public class ResultPropertyCollection  : DictionaryBase\r
55         {\r
56                 public ResultPropertyValueCollection this[string key]\r
57                 {\r
58                         get {return (ResultPropertyValueCollection) this.Dictionary[key]; }\r
59 \r
60                         set { this.Dictionary[key] = value; } \r
61                 }\r
62                 //add a ResultPropertyValueCollection based on key \r
63                 public void Add(string key, ResultPropertyValueCollection rpcoll) \r
64                 { \r
65                         this.Dictionary.Add(key, rpcoll); \r
66                 } \r
67                 //see if collection contains an entry corresponding to key\r
68                 public bool Contains(string key)\r
69                 {\r
70                         return this.Dictionary.Contains(key);\r
71                 }\r
72                 \r
73                 public ICollection PropertyNames \r
74                 {\r
75                         get\r
76                         {\r
77                                 return this.Dictionary.Keys;\r
78                         }\r
79                 }\r
80 \r
81                 public ICollection Values \r
82                 {\r
83                         get\r
84                         {\r
85                                         return this.Dictionary.Values;\r
86                         }\r
87                 }\r
88 \r
89         }\r
90 }\r
91 \r