コード例 #1
0
 /// <summary>
 /// Initializes the control with the instance of MapWinGIS class
 /// </summary>
 public void Initialize(MapWinGIS.Interfaces.IMapWin mapWin)
 {
     m_mapWin         = mapWin;
     m_multiselect    = true;
     m_controlType    = CustomType.Default;
     this.LayerAdded += new LayerAddedDelegate(LayersControl_LayerAdded);
 }
コード例 #2
0
        /// <summary>
        /// Creates new instance of LayersDialog class
        /// </summary>
        /// <param name="mapWin">Reference to MapWinGIS 4</param>
        /// <param name="layerTypes">Layer types to be included in the list</param>
        /// <param name="selection">List of filesnames to be checked</param>
        public LayersDialog(MapWinGIS.Interfaces.IMapWin mapWin, MapWinGIS.Interfaces.eLayerType[] layerTypes, IEnumerable <string> selection)
        {
            InitializeComponent();
            if (mapWin == null)
            {
                throw new NullReferenceException();
            }

            m_mapWin = mapWin;

            this.listView1.Items.Clear();
            foreach (Layer layer in mapWin.Layers)
            {
                foreach (eLayerType type in layerTypes)
                {
                    if (layer.LayerType == type)
                    {
                        ListViewItem item = new ListViewItem(layer.Name);
                        item.Tag = layer;

                        if (selection != null && selection.Contains(layer.FileName))
                        {
                            item.Checked = true;
                        }

                        listView1.Items.Add(item);
                        break;
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// 创建一个新的MismatchTester类实例
        /// </summary>
        /// <param name="mapWin"></param>
        public MismatchTester(MapWinGIS.Interfaces.IMapWin mapWin)
        {
            if (mapWin == null)
            {
                throw new NullReferenceException("没有声明的MapWinGIS");
            }

            m_mapWin = mapWin;
        }
コード例 #4
0
        /// <summary>
        /// Creates a new instance of the frmExportShapefile class
        /// </summary>
        public frmExportShapefile(MapWinGIS.Interfaces.IMapWin mapWin)
        {
            InitializeComponent();

            if (mapWin == null)
            {
                throw new ArgumentException("No refernce to MapWinGIS was passed");
            }

            m_mapWin = mapWin;

            IEnumerable <MapWinGIS.Interfaces.Layer> layers =
                m_mapWin.Layers.Where(layer => layer.LayerType == eLayerType.LineShapefile ||
                                      layer.LayerType == eLayerType.PointShapefile ||
                                      layer.LayerType == eLayerType.PolygonShapefile);

            foreach (Layer layer in layers)
            {
                ListViewItem item = this.listView1.Items.Add(layer.Name);
                item.Tag = layer;
            }
        }
コード例 #5
0
 /// <summary>
 /// Creates a new instance of LayersDialog class, with no selected layers passed
 /// </summary>
 /// <param name="mapWin">Reference to MapWinGIS 4</param>
 /// <param name="layerTypes">Layer types to be included in the list</param>
 public LayersDialog(MapWinGIS.Interfaces.IMapWin mapWin, MapWinGIS.Interfaces.eLayerType[] layerTypes) : this(mapWin, layerTypes, null)
 {
 }