(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.DirectoryServices / System.DirectoryServices / SearchResultCollection.cs
blob7c79a852933b847beb4bedcd9f5b72a71c6ae75a
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.SearchResultCollection.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 SearchResult instances that the Active Directory
40 /// hierarchy returned during a DirectorySearcher query.
41 /// </summary>
42 /// <remarks>
43 /// Each time you perform a query, DirectorySearcher creates a handle to
44 /// the corresponding SearchResultCollection instance. This handle
45 /// persists until you call Dispose or until garbage collection picks up
46 /// the instance.
47 /// </remarks>
48 public class SearchResultCollection : MarshalByRefObject, ICollection, IEnumerable, IDisposable
50 private ArrayList sValues = new ArrayList();
52 internal SearchResultCollection()
56 public int Count
58 get{return sValues.Count;}
61 bool ICollection.IsSynchronized
63 get{return sValues.IsSynchronized;}
66 object ICollection.SyncRoot
68 get{return sValues.SyncRoot;}
71 void ICollection.CopyTo(System.Array oArray, int iArrayIndex)
73 sValues.CopyTo(oArray, iArrayIndex);
76 public void CopyTo(SearchResult[] results, int index)
78 ((ICollection) this).CopyTo((System.Array)results,index);
81 internal void Add(object oValue)
83 sValues.Add(oValue);
86 public bool IsFixedSize
88 get{return m_oKeys.IsFixedSize;}
91 public bool IsReadOnly
93 get{return m_oKeys.IsReadOnly;}
96 public ICollection Keys
98 get{return m_oValues.Keys;}
101 public void Clear()
103 m_oValues.Clear();
104 m_oKeys.Clear();
107 public bool Contains(object oKey)
109 return m_oValues.Contains(oKey);
112 public bool ContainsKey(object oKey)
114 return m_oValues.ContainsKey(oKey);
117 public IDictionaryEnumerator GetEnumerator()
119 return m_oValues.GetEnumerator();
122 public void Remove(object oKey)
124 m_oValues.Remove(oKey);
125 m_oKeys.Remove(oKey);
128 public object this[object oKey]
130 get{return m_oValues[oKey];}
131 set{m_oValues[oKey] = value;}
134 bool Contains(object oValues)
136 return sValues.Contains(oValues);
139 public bool Contains(SearchResult result)
141 return Contains(result);
144 public SearchResult this[int index]
146 get{return (SearchResult)sValues[index];}
149 /* public ICollection Values
151 get{return m_oValues.Values;}
154 public int IndexOf (SearchResult result)
156 return sValues.IndexOf(result);
159 public IEnumerator GetEnumerator()
161 return sValues.GetEnumerator();
164 public void Dispose ()
166 Dispose (true);
167 GC.SuppressFinalize (this);
170 [MonoTODO]
171 protected virtual void Dispose (bool disposing)
175 public string[] PropertiesLoaded
177 [MonoTODO]
178 get { throw new NotImplementedException (); }
181 public IntPtr Handle
183 [MonoTODO]
184 get { throw new NotImplementedException (); }
187 ~SearchResultCollection ()
189 Dispose (false);