コード例 #1
0
        public void AddToolbarTest()
        {
            Toolbar target   = new Toolbar(); // TODO: Initialize to an appropriate value
            string  Name     = string.Empty;  // TODO: Initialize to an appropriate value
            bool    expected = false;         // TODO: Initialize to an appropriate value
            bool    actual;

            actual = target.AddToolbar(Name);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #2
0
        //  SimMain scConvas;

        //This event is fired when the user loads your plug-in either through the plug-in dialog
        //box, or by checkmarking it in the plug-ins menu.  This is where you would add buttons to the
        //tool bar or menu items to the menu.
        //It is also standard to set a global reference to the IMapWin that is passed through here so that
        //you can access it elsewhere in your project to act on MapWindow.
        public void Initialize(MapWindow.Interfaces.IMapWin m_MapWin, int ParentHandle)
        {
            this.mMapWin = m_MapWin;
            this.convas  = (Form)Control.FromHandle(new IntPtr(ParentHandle));
            //conv
            ResourceManager res     = new ResourceManager("GISTranSim.Properties.Resources", Assembly.GetExecutingAssembly());
            Toolbar         toolbar = mMapWin.Toolbar;;

            toolbar.AddToolbar(strToolBar);
            if (strToolBar.Length > 0)
            {
                toolbar.AddToolbar(strToolBar);
            }

            TBTN_Config          = toolbar.AddButton(strBTNConfig, strToolBar, string.Empty, string.Empty);
            TBTN_Config.Tooltip  = "配置仿真应用程序";
            TBTN_Config.Category = strToolBar;
            TBTN_Config.Picture  = res.GetObject("Config");
            TBTN_Config.Enabled  = true;

            TBTN_Config.Text = strBTNConfig; //this.res.GetString("textCreateShp");

            TBTN_Run          = toolbar.AddButton(strBTNRun, strToolBar, false);
            TBTN_Run.Category = strToolBar;
            TBTN_Run.Text     = strBTNRun;
            TBTN_Run.Tooltip  = "运行仿真应用程序";
            TBTN_Run.Enabled  = false;
            TBTN_Run.Picture  = res.GetObject("Run");


            TBTN_Pause          = toolbar.AddButton(strBTNPause, strToolBar, false);
            TBTN_Pause.Category = strToolBar;
            TBTN_Pause.Text     = strBTNPause;
            TBTN_Pause.Tooltip  = "停止仿真程序";
            TBTN_Pause.Enabled  = false;
            TBTN_Pause.Picture  = res.GetObject("Pause");


            TBTN_ChartSpeedTime          = toolbar.AddButton(strBTNSpaceTime, strToolBar, false);
            TBTN_ChartSpeedTime.Category = strToolBar;
            TBTN_ChartSpeedTime.Text     = strBTNSpaceTime;
            TBTN_ChartSpeedTime.Tooltip  = "输出时空图像";
            TBTN_ChartSpeedTime.Enabled  = false;
            TBTN_ChartSpeedTime.Picture  = res.GetObject("Chart2");


            TBTN_ChartSpaceTime          = toolbar.AddButton(strBTNSpeedTime, strToolBar, false);
            TBTN_ChartSpaceTime.Category = strToolBar;
            TBTN_ChartSpaceTime.Text     = strBTNSpeedTime;
            TBTN_ChartSpaceTime.Tooltip  = "输出速度时间图像";
            TBTN_ChartSpaceTime.Enabled  = false;
            TBTN_ChartSpaceTime.Picture  = res.GetObject("Chart1");


            TBTN_ChartMeanSpeed          = toolbar.AddButton(strBTNMeanSpeed, strToolBar, false);
            TBTN_ChartMeanSpeed.Category = strToolBar;
            TBTN_ChartMeanSpeed.Text     = strBTNSpeedTime;
            TBTN_ChartMeanSpeed.Tooltip  = "输出平均速度图像";
            TBTN_ChartMeanSpeed.Enabled  = false;
            TBTN_ChartMeanSpeed.Picture  = res.GetObject("Save");

            TBTN_ShowData          = toolbar.AddButton(strBTNShowData, strToolBar, false);
            TBTN_ShowData.Category = strToolBar;
            TBTN_ShowData.Text     = strBTNShowData;
            TBTN_ShowData.Tooltip  = "输出仿真数据";
            TBTN_ShowData.Enabled  = false;
            TBTN_ShowData.Picture  = res.GetObject("Data");
        }