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 FdoPropertyDefinitionCollection; 00022 00023 BEGIN_NAMESPACE_OSGEO_FDO_SCHEMA 00024 public __gc class PropertyDefinition; 00025 public __gc class SchemaElement; 00026 00027 /// \ingroup (OSGeoFDOSchema) 00028 /// \brief 00029 /// The PropertyDefinitionCollection class represents a collection of PropertyDefinition objects. 00030 [System::Reflection::DefaultMemberAttribute("RealTypeItem")] 00031 public __sealed __gc class PropertyDefinitionCollection : public NAMESPACE_OSGEO_RUNTIME::Disposable, public System::Collections::IList 00032 { 00033 /// \cond DOXYGEN-IGNORE 00034 private: 00035 /// \brief 00036 /// A Nested class defined to provide enumeration of Dictionary elements 00037 /// 00038 /// Enumerators can be used to read the data in the collection, 00039 /// but they cannot be used to modify the underlying collection. 00040 /// 00041 /// An enumerator remains valid as long as the collection remains unchanged. 00042 /// If changes are made to the collection, such as adding, modifying, or deleting 00043 /// elements, the enumerator is irrecoverably invalidated and the next call to 00044 /// MoveNext or Reset throws an InvalidOperationException. If the collection is 00045 /// modified between MoveNext and Current, Current returns the element that it is 00046 /// set to, even if the enumerator is already invalidated. 00047 /// 00048 /// The enumerator does not have exclusive access to the collection; therefore, 00049 /// enumerating through a collection is intrinsically not a thread-safe procedure. 00050 /// Even when a collection is synchronized, other threads can still modify the 00051 /// collection, which causes the enumerator to throw an exception. To guarantee 00052 /// thread safety during enumeration, you can either lock the collection during 00053 /// the entire enumeration or catch the exceptions resulting from changes made 00054 /// by other threads. 00055 /// 00056 __gc class Enumerator : public System::Collections::IEnumerator 00057 { 00058 private: 00059 PropertyDefinitionCollection* m_pCol; 00060 System::Int32 m_nIdx; 00061 00062 public: 00063 /// \brief 00064 /// Constructs a new Collection Enumerator 00065 /// 00066 /// \param col 00067 /// Input The collection to enumerate. 00068 /// 00069 Enumerator(PropertyDefinitionCollection* elements) : m_pCol(elements), m_nIdx(-1) 00070 { 00071 00072 } 00073 00074 /// \brief 00075 /// Retrieves the current object at the enumerator location 00076 /// 00077 /// \return 00078 /// Retuns the current object referenced by the enumerator 00079 /// 00080 __property System::Object *get_Current(); 00081 00082 /// \brief 00083 /// Initially, the enumerator is positioned before the first object in the collection. 00084 /// At this position, calling the Current property throws an exception. 00085 /// Therefore, you must call the MoveNext method to advance the enumerator 00086 /// to the first element of the collection before reading the value of Current. 00087 /// If MoveNext passes the end of the collection, the enumerator is positioned 00088 /// after the last element in the collection and MoveNext returns false. 00089 /// When the enumerator is at this position, subsequent calls to MoveNext also return false. 00090 /// If the last call to MoveNext returned false, calling Current throws an exception. 00091 /// To set Current to the first element of the collection again, you can call Reset 00092 /// followed by MoveNext. 00093 /// 00094 /// \return 00095 /// Retuns true if the Enumerator is able to move to a valid element 00096 /// otherwise false. 00097 /// 00098 System::Boolean MoveNext(); 00099 00100 /// \brief 00101 /// Initially, the enumerator is positioned before the first element in the collection. 00102 /// The Reset method brings the enumerator back to this position. 00103 /// 00104 System::Void Reset(); 00105 }; 00106 00107 public private: 00108 inline FdoPropertyDefinitionCollection* GetImpObj(); 00109 00110 private: 00111 // System::Collections::ICollection interface properties 00112 __property System::Object* System::Collections::ICollection::get_SyncRoot(); 00113 __property System::Boolean System::Collections::ICollection::get_IsSynchronized(); 00114 00115 // System::Collections::ICollection interface methods 00116 System::Void System::Collections::ICollection::CopyTo(System::Array* array,System::Int32 index); 00117 00118 // System::Collections::IList interface properties 00119 __property System::Boolean System::Collections::IList::get_IsFixedSize(); 00120 __property System::Boolean System::Collections::IList::get_IsReadOnly(); 00121 __property Object* System::Collections::IList::get_Item(System::Int32 index); 00122 __property System::Void System::Collections::IList::set_Item(System::Int32 index, Object* value); 00123 00124 // System::Collections::IList interface methods 00125 System::Int32 System::Collections::IList::Add(Object* value); 00126 System::Boolean System::Collections::IList::Contains(Object* value); 00127 System::Int32 System::Collections::IList::IndexOf(Object* value); 00128 System::Void System::Collections::IList::Insert(System::Int32 index, Object* value); 00129 System::Void System::Collections::IList::Remove(Object* value); 00130 00131 protected: 00132 System::Void ReleaseUnmanagedObject(); 00133 /// \endcond 00134 00135 public: 00136 /// \brief 00137 /// Constructs a PropertyDefinitionCollection object 00138 /// 00139 /// \param parent 00140 /// Input A Pointer to the parent schema object of the collection 00141 /// 00142 PropertyDefinitionCollection(NAMESPACE_OSGEO_FDO_SCHEMA::SchemaElement* parent); 00143 00144 /// \brief 00145 /// Constructs a PropertyDefinitionCollection object based on an unmanaged instance of the object 00146 /// 00147 /// \param unmanaged 00148 /// Input A Pointer to the unmanaged object. 00149 /// 00150 /// \param autoDelete 00151 /// Input Indicates if the constructed object should be automatically deleted 00152 /// once it no longer referenced. 00153 /// 00154 PropertyDefinitionCollection(System::IntPtr unmanaged, System::Boolean autoDelete) : NAMESPACE_OSGEO_RUNTIME::Disposable(unmanaged, autoDelete) 00155 { 00156 00157 } 00158 00159 /// \brief 00160 /// Gets the count of items in collection. 00161 /// 00162 /// \return 00163 /// Returns the number of items in the collection. 00164 /// 00165 __property System::Int32 get_Count(System::Void); 00166 00167 /// \brief 00168 /// Gets an enumerator that can iterate through a collection. 00169 /// 00170 /// \return 00171 /// Returns an enumerator on the dictionary. 00172 /// 00173 __sealed System::Collections::IEnumerator* GetEnumerator(System::Void); 00174 00175 /// \brief 00176 /// Removes the index-th PropertyDefinition from this collection. 00177 /// 00178 /// \param index 00179 /// Input index of the element to remove. 00180 /// 00181 System::Void RemoveAt(System::Int32 index); 00182 00183 /// \brief 00184 /// Removes all elements from the collection. 00185 /// 00186 System::Void Clear(); 00187 00188 /// \brief 00189 /// Adds a PropertyDefinition object into the collection. 00190 /// 00191 /// \param value 00192 /// Input the PropertyDefinition object to add. 00193 /// 00194 /// \return 00195 /// Returns the position into which the new element was inserted. 00196 /// 00197 System::Int32 Add(PropertyDefinition* value); 00198 00199 /// \brief 00200 /// Determines the index of a specific PropertyDefinition object. 00201 /// 00202 /// \param value 00203 /// Input the PropertyDefinition object to locate in the collection. 00204 /// 00205 /// \return 00206 /// The index of value if found in the collection; otherwise, -1. 00207 /// 00208 System::Int32 IndexOf(PropertyDefinition* value); 00209 00210 /// \brief 00211 /// Determines the index of a specific PropertyDefinition object. 00212 /// 00213 /// \param name 00214 /// Input the name of the PropertyDefinition object to locate in the collection. 00215 /// 00216 /// \return 00217 /// The index of value if found in the collection; otherwise, -1. 00218 /// 00219 System::Int32 IndexOf(String* name); 00220 00221 /// \brief 00222 /// Inserts a PropertyDefinition object into the collection at the specified position. 00223 /// 00224 /// \param index 00225 /// Input the zero-based index at which value should be inserted. 00226 /// \param value 00227 /// Input the PropertyDefinition object to insert. 00228 /// 00229 System::Void Insert(System::Int32 index, PropertyDefinition* value); 00230 00231 /// \brief 00232 /// Removes the first occurrence of a specific PropertyDefinition object. 00233 /// 00234 /// \param value 00235 /// Input the PropertyDefinition object to remove from the collection. 00236 /// 00237 System::Void Remove(PropertyDefinition* value); 00238 00239 /// \brief 00240 /// Determines whether the collection contains a specific PropertyDefinition object. 00241 /// 00242 /// \param value 00243 /// Input The PropertyDefinition object to search in the collection. 00244 /// 00245 /// \return 00246 /// Returns true if the value is found in the collection; otherwise, false. 00247 /// 00248 System::Boolean Contains(PropertyDefinition* value); 00249 00250 /// \brief 00251 /// Determines whether the collection contains a specific PropertyDefinition object. 00252 /// 00253 /// \param name 00254 /// Input The name of the PropertyDefinition object to search in the collection. 00255 /// 00256 /// \return 00257 /// Returns true if the value is found in the collection; otherwise, false. 00258 /// 00259 System::Boolean Contains(String* name); 00260 00261 /// \brief 00262 /// Copies the elements of the collection to an array. 00263 /// 00264 /// \param array 00265 /// Output the one-dimensional Array that is the destination of the elements copied from this collection. 00266 /// \param startAt 00267 /// Input an integer that represents the index in array at which copying begins. 00268 /// 00269 System::Void CopyTo(PropertyDefinition* array[],System::Int32 startAt); 00270 00271 /// \brief 00272 /// Gets the item in the collection at the specified index. 00273 /// 00274 /// \param index 00275 /// The index of the item in the collection. The index is 0 based. 00276 /// 00277 /// \return 00278 /// Returns an instance of a the collected item. 00279 /// Throws an instance of Exception if the index is out of range or an error occurs. 00280 /// 00281 __property PropertyDefinition* get_RealTypeItem(System::Int32 index); 00282 00283 /// \brief 00284 /// Gets the item in the collection by name. 00285 /// 00286 /// \param index 00287 /// The name of the item in the collection. 00288 /// 00289 /// \return 00290 /// Returns an instance of a the collected item. 00291 /// 00292 __property PropertyDefinition* get_RealTypeItem(System::String* index); 00293 00294 /// \brief 00295 /// Sets the value of the item at the specified index 00296 /// 00297 /// \param index 00298 /// Input index of the item to set. 00299 /// 00300 /// \param value 00301 /// Input the value of the item 00302 /// 00303 __property System::Void set_RealTypeItem(System::Int32 index, PropertyDefinition* value); 00304 00305 /// \brief 00306 /// Gets an item in the collection. 00307 /// 00308 /// \param index 00309 /// Input index of the item to retrieve. 00310 /// 00311 /// \return 00312 /// Returns the item at the specified index 00313 /// 00314 __property PropertyDefinition* get_Item(System::Int32 index); 00315 00316 /// \brief 00317 /// Sets the value of the item at the specified index 00318 /// 00319 /// \param index 00320 /// Input index of the item to set. 00321 /// 00322 /// \param value 00323 /// Input the value of the item 00324 /// 00325 __property System::Void set_Item(System::Int32 index, PropertyDefinition* value); 00326 }; 00327 00328 END_NAMESPACE_OSGEO_FDO_SCHEMA 00329 00330
Comments or suggestions? Send us feedback. |