Common Custom data source
Common_CustomDataSource_CSharp\REXMLDataSource_CSharp\MapInformation.cs
// Copyright 2010 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See the use restrictions.
// 


namespace REXMLDataSource_CSharp
{
    // The IMapInformation interface provides access to common properties of a map resource.
    public class MapInformation : ESRI.ArcGIS.ADF.Web.DataSources.IMapInformation
    {
        #region Instance Variable Declarations

        private string m_dataFrame = string.Empty;
        private ESRI.ArcGIS.ADF.Web.SpatialReference.SpatialReference m_defaultSpatialReference = null;
        private ESRI.ArcGIS.ADF.Web.DataSources.TileCacheInfo m_tileCacheInfo = null;
        private ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsDataSet m_graphicsDataSet = null;

        #endregion 

        #region Constructor

        public MapInformation(ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsDataSet graphicsDataSet)
        {
            m_graphicsDataSet = graphicsDataSet;
        }

        #endregion

        #region IMapInformation Members

        public string DataFrame
        {
            get { return m_dataFrame; }
        }

        public ESRI.ArcGIS.ADF.Web.SpatialReference.SpatialReference DefaultSpatialReference
        {
            get { return m_defaultSpatialReference; }
        }

        public ESRI.ArcGIS.ADF.Web.Geometry.Envelope DefaultExtent
        {
            get
            { return m_graphicsDataSet == null ? null : m_graphicsDataSet.DefaultExtent; }
        }

        public ESRI.ArcGIS.ADF.Web.Geometry.Envelope FullExtent
        {
            get
            { return m_graphicsDataSet == null ? null : m_graphicsDataSet.FullExtent; }
        }

        public ESRI.ArcGIS.ADF.Web.DataSources.TileCacheInfo TileCacheInfo
        {
            get { return m_tileCacheInfo; }
            set { m_tileCacheInfo = value; }
        }

        #endregion
    }
}