FDO .NET API Reference Feature Data Objects

mgXmlAttributeCollection.h

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

Comments or suggestions? Send us feedback.