#region Disclaimer / License // Copyright (C) 2009, Kenneth Skovhede // http://www.hexad.dk, opensource@hexad.dk // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #endregion namespace OSGeo.MapGuide.MaestroAPI { /// /// Represents a list of data in a featuresource /// [System.Xml.Serialization.XmlRootAttribute("DataStoreList", Namespace="", IsNullable=false)] public class DataStoreList { private ServerConnectionI m_serverConnection; /// /// Gets or sets the connection used in various operations performed on this object /// [System.Xml.Serialization.XmlIgnore()] public ServerConnectionI CurrentConnection { get { return m_serverConnection; } set { m_serverConnection = value; } } /// /// The name of the xsd document that will be used to validate this class before and after serialization /// [System.Xml.Serialization.XmlIgnore()] public static readonly string SchemaName = "DataStoreList-1.0.0.xsd"; /// /// Gets the name of the xsd document that will be used to validate this class before and after serialization /// [System.Xml.Serialization.XmlAttribute("noNamespaceSchemaLocation", Namespace="http://www.w3.org/2001/XMLSchema-instance")] public string XsdSchema { get { return SchemaName; } set { if (value != SchemaName) throw new System.Exception("Cannot set the schema name"); } } private DataStoreItemCollection m_dataStore; /// /// Gets or sets the datastore elements /// [System.Xml.Serialization.XmlElementAttribute("DataStore")] public DataStoreItemCollection DataStore { get { return this.m_dataStore; } set { this.m_dataStore = value; } } } /// /// Represents a single datastore item /// public class DataStoreItem { private string m_name; private bool m_fdoEnabled; /// /// Gets or sets name of the data item /// public string Name { get { return this.m_name; } set { this.m_name = value; } } /// /// Gets or sets a value indicating if this item is FDO enabled /// public bool FdoEnabled { get { return this.m_fdoEnabled; } set { this.m_fdoEnabled = value; } } } /// /// Represents a list of datastore items /// public class DataStoreItemCollection : System.Collections.CollectionBase { /// /// Gets or sets a datastore item, using the item index /// public DataStoreItem this[int idx] { get { return ((DataStoreItem)(base.InnerList[idx])); } set { base.InnerList[idx] = value; } } /// /// Adds a datastore item /// /// The item to add /// The newly assigned index public int Add(DataStoreItem value) { return base.InnerList.Add(value); } } }