FDO .NET API Reference | Feature Data Objects |
00001 /* 00002 * Copyright (C) 2004-2006 Autodesk, Inc. 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of version 2.1 of the GNU Lesser 00006 * General Public License as published by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Lesser General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public 00014 * License along with this library; if not, write to the Free Software 00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00016 * 00017 */ 00018 00019 #pragma once 00020 00021 class FdoProviderCollection; 00022 00023 BEGIN_NAMESPACE_OSGEO_FDO_CLIENTSERVICES 00024 public __gc class Provider; 00025 END_NAMESPACE_OSGEO_FDO_CLIENTSERVICES 00026 00027 BEGIN_NAMESPACE_OSGEO_FDO_CLIENTSERVICES 00028 00029 /// \ingroup (OSGeoFDOClientServices) 00030 /// \brief 00031 /// Class ProviderCollection is a read-only collection consisting of the FDO Providers that are currently registered. 00032 /// Each collected Provider object describes an installed and registered FDO Feature Provider. 00033 [System::Reflection::DefaultMemberAttribute("RealTypeItem")] 00034 public __sealed __gc class ProviderCollection : public NAMESPACE_OSGEO_RUNTIME::Disposable, 00035 public System::Collections::ICollection, 00036 public System::Collections::IEnumerable 00037 { 00038 /// \cond DOXYGEN-IGNORE 00039 private: 00040 /// \brief 00041 /// A Nested class defined to provide enumeration of Dictionary elements 00042 /// 00043 /// Enumerators can be used to read the data in the collection, 00044 /// but they cannot be used to modify the underlying collection. 00045 /// 00046 /// An enumerator remains valid as long as the collection remains unchanged. 00047 /// If changes are made to the collection, such as adding, modifying, or deleting 00048 /// elements, the enumerator is irrecoverably invalidated and the next call to 00049 /// MoveNext or Reset throws an InvalidOperationException. If the collection is 00050 /// modified between MoveNext and Current, Current returns the element that it is 00051 /// set to, even if the enumerator is already invalidated. 00052 /// 00053 /// The enumerator does not have exclusive access to the collection; therefore, 00054 /// enumerating through a collection is intrinsically not a thread-safe procedure. 00055 /// Even when a collection is synchronized, other threads can still modify the 00056 /// collection, which causes the enumerator to throw an exception. To guarantee 00057 /// thread safety during enumeration, you can either lock the collection during 00058 /// the entire enumeration or catch the exceptions resulting from changes made 00059 /// by other threads. 00060 /// 00061 __gc class Enumerator : public System::Collections::IEnumerator 00062 { 00063 private: 00064 ProviderCollection* m_pCol; 00065 System::Int32 m_nIdx; 00066 00067 public: 00068 /// \brief 00069 /// Constructs a new Collection Enumerator 00070 /// 00071 /// \param elements 00072 /// Input The collection to enumerate. 00073 /// 00074 Enumerator(ProviderCollection* elements) : m_pCol(elements), m_nIdx(-1) 00075 { 00076 00077 } 00078 00079 /// \brief 00080 /// Retrieves the current object at the enumerator location 00081 /// 00082 /// \return 00083 /// Retuns the current object referenced by the enumerator 00084 /// 00085 __property System::Object *get_Current(); 00086 00087 /// \brief 00088 /// Initially, the enumerator is positioned before the first element in the collection. 00089 /// At this position, calling the Current property throws an exception. 00090 /// Therefore, you must call the MoveNext method to advance the enumerator 00091 /// to the first element of the collection before reading the value of Current. 00092 /// If MoveNext passes the end of the collection, the enumerator is positioned 00093 /// after the last element in the collection and MoveNext returns false. 00094 /// When the enumerator is at this position, subsequent calls to MoveNext also return false. 00095 /// If the last call to MoveNext returned false, calling Current throws an exception. 00096 /// To set Current to the first element of the collection again, you can call Reset 00097 /// followed by MoveNext. 00098 /// 00099 /// \return 00100 /// Retuns true if the Enumerator is able to move to a valid element 00101 /// otherwise false. 00102 /// 00103 System::Boolean MoveNext(); 00104 00105 /// \brief 00106 /// Initially, the enumerator is positioned before the first element in the collection. 00107 /// The Reset method brings the enumerator back to this position. 00108 /// 00109 System::Void Reset(); 00110 }; 00111 00112 public private: 00113 /// \brief 00114 /// Constructs a ProviderCollection managed object based on an unmanaged instance of the object 00115 /// 00116 /// \param unmanaged 00117 /// Input A Pointer to the unmanaged object. 00118 /// 00119 /// \param autoDelete 00120 /// Input Indicates if the constructed object should be automatically deleted 00121 /// once it no longer referenced. 00122 /// 00123 ProviderCollection(System::IntPtr unmanaged, System::Boolean autoDelete) 00124 : Disposable(unmanaged, autoDelete) 00125 { 00126 } 00127 00128 inline FdoProviderCollection* GetImpObj(); 00129 00130 private: 00131 // System::Collections::ICollection interfaces 00132 System::Void System::Collections::ICollection::CopyTo(System::Array* array,System::Int32 index); 00133 __property System::Object* System::Collections::ICollection::get_SyncRoot(); 00134 __property System::Boolean System::Collections::ICollection::get_IsSynchronized(); 00135 00136 protected: 00137 System::Void ReleaseUnmanagedObject(); 00138 /// \endcond 00139 00140 public: 00141 /// \brief 00142 /// Gets the number of items in the collection 00143 /// 00144 /// \return 00145 /// Returns an int containing the number of items. 00146 /// Throws an instance of Exception if an error occurs. 00147 /// 00148 __property System::Int32 get_Count(System::Void); 00149 00150 /// \brief 00151 /// Gets an enumerator that can iterate through a collection. 00152 /// 00153 /// \return 00154 /// Returns an enumerator for the collection. 00155 /// 00156 __sealed System::Collections::IEnumerator* GetEnumerator(System::Void); 00157 00158 /// \brief 00159 /// Determines if the collection contains the specified item 00160 /// 00161 /// \param name 00162 /// The unique name of the feature provider. This name should be of the form 00163 /// [Company].[Provider].[Version]. 00164 /// 00165 /// \return 00166 /// Returns true if the collection contains the specified item, otherwise false. 00167 /// Throws an instance of Exception if an error occurs. 00168 /// 00169 System::Boolean Contains(System::String* name); 00170 00171 /// \brief 00172 /// Returns the index of the specified item in the collection. 00173 /// 00174 /// \param name 00175 /// The unique name of the feature provider. This name should be of the form 00176 /// [Company].[Provider].[Version]. 00177 /// 00178 /// \return 00179 /// Returns the index item or -1 if the item does not exist. Index is 0 based. 00180 /// Throws an instance of Exception if an error occurs. 00181 /// 00182 System::Int32 IndexOf(System::String* name); 00183 00184 /// \brief 00185 /// Copies the elements of the collection to an array. 00186 /// 00187 /// \param array 00188 /// Output the one-dimensional Array that is the destination of the elements copied from this collection. 00189 /// 00190 /// \param index 00191 /// Input an integer that represents the index in array at which copying begins. 00192 /// 00193 System::Void CopyTo(System::String* array[],System::Int32 index); 00194 00195 /// \brief 00196 /// Gets the Provider item in the collection at the specified index. 00197 /// 00198 /// \param index 00199 /// The index of the provider in the collection. The index is 0 based. 00200 /// 00201 /// \return 00202 /// Returns an instance of a Provider. 00203 /// Throws an instance of Exception if the index is out of range or an error occurs. 00204 /// 00205 __property NAMESPACE_OSGEO_FDO_CLIENTSERVICES::Provider *get_RealTypeItem(System::Int32 index); 00206 }; 00207 00208 END_NAMESPACE_OSGEO_FDO_CLIENTSERVICES 00209 00210
Comments or suggestions? Send us feedback. |