Common CustomDataSource
Common_CustomDataSource_CSharp\CustomDataSource_CSharp\REXMLDataSource_CSharp\MapInformation.cs
// Copyright 2007 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.
//

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using ESRI.ArcGIS.ADF.Web.DataSources;
using System.Collections;

using ESRI.ArcGIS.ADF.Web.Display.Graphics;
using ESRI.ArcGIS.ADF.Web.Display.Drawing;
using ESRI.ArcGIS.ADF.Web.Geometry;
using ESRI.ArcGIS.ADF.Web.SpatialReference;

namespace REXMLDataSource_CSharp
{
    public class MapInformation : IMapInformation
    {
        public MapInformation(GraphicsDataSet graphics)
        {
            this.graphics = graphics;
        }

        private string dataFrame = string.Empty;
        private SpatialReference defaultSpatialReference = null;
        private TileCacheInfo tileCacheInfo = null;
        private GraphicsDataSet graphics = null;

        public string DataFrame
        {
            get { return dataFrame; }
        }

        public SpatialReference DefaultSpatialReference
        {
            get { return defaultSpatialReference; }
        }

        public Envelope DefaultExtent
        {
            get
            {
                if (graphics == null)
                    return null;
                else
                    return graphics.DefaultExtent;
            }
        }

        public Envelope FullExtent
        {
            get
            {
                if (graphics == null)
                    return null;
                else
                    return graphics.FullExtent;
            }
        }

        public TileCacheInfo TileCacheInfo
        {
            get { return tileCacheInfo; }
            set { tileCacheInfo = value; }
        }
    }
}