public OpenMxdCommand(ControlsSynchronizer controlsSynchronizer)
        {
            //
            // TODO: Define values for the public properties
            //
            base.m_category = "打开地图文档"; //localizable text
            base.m_caption  = "打开地图文档"; //localizable text
            base.m_message  = "打开地图文档"; //localizable text
            base.m_toolTip  = "打开地图文档"; //localizable text
            base.m_name     = "打开地图文档"; //unique id, non-localizable (e.g. "MyCategory_MyCommand")

            pControlsSynchronizer = controlsSynchronizer;


            try
            {
                //
                // TODO: change bitmap name if necessary
                //
                string bitmapResourceName = GetType().Name + ".bmp";
                base.m_bitmap = new Bitmap(GetType(), bitmapResourceName);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
            }
        }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            OpenMxdCommand pMxdCommand = new OpenMxdCommand();

            axToolbarControl1.AddItem(pMxdCommand, -1, 0, false, -1,
                                      esriCommandStyles.esriCommandStyleIconOnly);

            pMapControlsSynchronizer = new ControlsSynchronizer((IMapControl3)axMapControl1.Object,
                                                                (IPageLayoutControl2)axPageLayoutControl1.Object);
            pMapControlsSynchronizer.BindControls(true);
            pMapControlsSynchronizer.AddFrameworkControl(axToolbarControl1.Object);
            pMapControlsSynchronizer.AddFrameworkControl(axTOCControl1.Object);
            //get the MapControl
            m_mapControl = (IMapControl3)axMapControl1.Object;
        }