Esempio n. 1
0
        public override void Execute(object parameter)
        {
            IMapDocument   xjMxdMapDocument    = new MapDocumentClass();
            OpenFileDialog xjMxdOpenFileDialog = new OpenFileDialog();

            xjMxdOpenFileDialog.Filter = "地图文档(*.mxd)|*.mxd";
            if (xjMxdOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                string xjmxdFilePath = xjMxdOpenFileDialog.FileName;
                if (MapControl.CheckMxFile(xjmxdFilePath))
                {
                    MapControl.Map.ClearLayers();
                    MapControl.LoadMxFile(xjmxdFilePath);
                }
                MapControl.ActiveView.Refresh();
            }
        }