Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtentCalculationDialog"/> class.
        /// </summary>
        /// <param name="mdf">The MDF.</param>
        public ExtentCalculationDialog(IMapDefinition mdf)
        {
            InitializeComponent();
            _mdf = mdf;
            grdCalculations.DataSource = _results;

            prgCalculations.Maximum = mdf.GetLayerCount();
            if (mdf.BaseMap != null)
                prgCalculations.Maximum += GetLayerCount(mdf.BaseMap);

            txtCoordinateSystem.Text = mdf.CoordinateSystem;
        }
Ejemplo n.º 2
0
        protected bool Matches(RuntimeMap map, IMapDefinition mdf)
        {
            if (map.MapDefinition != mdf.ResourceID) return false;
            if (map.Groups.Count != mdf.GetGroupCount()) return false;
            if (map.Layers.Count != mdf.GetLayerCount()) return false;

            foreach (var layer in map.Layers)
            {
                var ldfr = mdf.GetLayerByName(layer.Name);
                if (ldfr == null) return false;

                if (layer.LayerDefinitionID != ldfr.ResourceId) return false;
                if (layer.LegendLabel != ldfr.LegendLabel) return false;
                if (layer.Visible != ldfr.Visible) return false;
                if (layer.Selectable != ldfr.Selectable) return false;
                if (layer.ShowInLegend != ldfr.ShowInLegend) return false;
                if (layer.ExpandInLegend != ldfr.ExpandInLegend) return false;
            }

            foreach (var group in map.Groups)
            {
                var grp = mdf.GetGroupByName(group.Name);
                if (grp == null) return false;

                if (group.ExpandInLegend != grp.ExpandInLegend) return false;
                if (group.Group != grp.Group) return false;
                if (group.LegendLabel != grp.LegendLabel) return false;
                if (group.Name != grp.Name) return false;
                if (group.ShowInLegend != grp.ShowInLegend) return false;
                if (group.Visible != grp.Visible) return false;
            }

            return true;
        }