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