コード例 #1
0
        /// <summary>
        /// Edits a value based on some user input which is collected from a character control.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="provider"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _dialogProvider = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            List <int>   layerList = new List <int>();
            LayoutLegend legend    = context.Instance as LayoutLegend;
            LayoutMap    map       = null;

            if (legend != null)
            {
                map = legend.Map;
            }
            if (map == null)
            {
                return(layerList);
            }

            CheckedListBox lb = new CheckedListBox();

            List <int> originalList = value as List <int>;

            if (originalList != null)
            {
                for (int i = map.MapControl.Layers.Count - 1; i >= 0; i--)
                {
                    lb.Items.Add(map.MapControl.Layers[i].LegendText, originalList.Contains(i));
                }
            }

            if (_dialogProvider != null)
            {
                _dialogProvider.DropDownControl(lb);
            }

            for (int i = 0; i < lb.Items.Count; i++)
            {
                if (lb.GetItemChecked(i))
                {
                    layerList.Add(lb.Items.Count - 1 - i);
                }
            }

            return(layerList);
        }
コード例 #2
0
 /// <summary>
 /// Pans the map the specified amount
 /// </summary>
 /// <param name="lm">the layout map to pan</param>
 /// <param name="x">The distance to pan the map on x-axis in screen coord</param>
 /// <param name="y">The distance to pan the map on y-axis in screen coord</param>
 public void PanMap(LayoutMap lm, float x, float y)
 {
     RectangleF mapOnScreen = PaperToScreen(lm.Rectangle);
     lm.PanMap((lm.Envelope.Width / mapOnScreen.Width) * x, (lm.Envelope.Height / mapOnScreen.Height) * -y);
 }
コード例 #3
0
 /// <summary>
 /// Zooms the specified map element to the full extent of its layers
 /// </summary>
 public void ZoomFullExtentMap(LayoutMap lm)
 {
     lm.ZoomToFullExtent();
 }
コード例 #4
0
 /// <summary>
 /// Zoom the specified map to the extent of the data view
 /// </summary>
 public void ZoomFullViewExtentMap(LayoutMap lm)
 {
     lm.ZoomViewExtent();
 }
コード例 #5
0
 /// <summary>
 /// Zooms the specified map element out by 10%
 /// </summary>
 public void ZoomOutMap(LayoutMap lm)
 {
     lm.ZoomOutMap();
 }