Example #1
0
 public frmLayers(MapWindow.Interfaces.IMapWin IMapWin)
 {
     InitializeComponent();
     _mapWin = IMapWin;
     //Set versionnr in statuslabel:
     VersionLabel.Text = "v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
     //Set Copyright in statuslabel:
     CopyrightLabel.Text = TemplatePluginVS2005.Classes.AssemblyInformation.ProductCopyright();
     //Fill combobox:
     TemplatePluginVS2005.Classes.pluginCode cls = new TemplatePluginVS2005.Classes.pluginCode(_mapWin);
     cls.fillVisibleLayers(this);
 }
        public void Initialize(MapWindow.Interfaces.IMapWin MapWin, int ParentHandle)
        {
            try
            {
                // testear
                //PostgresDataAccess.DataAccess da = new PostgresDataAccess.DataAccess();
                //#if USBKEY
                //utilizando llave USB
                //USBKey key = new USBKey();
                //if (!key.IniciarConexion("00"))
                //{
                //MessageBox.Show("Ha fallado la protección anticopia. Abortando inicio.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //return;
                //}
                //#endif
                // archivo
                FileInfo fi = new FileInfo(this.GetType().Assembly.Location);
                MapWin.Menus.AddMenu("mMain", (object)null, "Localización");

                // RPC

                try
                {
                    RemotingConfiguration.Configure(GetConfigFile(), false);
                    remoteZeus    = (RemoteZeus)Activator.GetObject(typeof(RemoteZeus), "http://*****:*****@gmail.com");
            }
        }
 /// <summary>
 /// Constructor
 /// </summary>
 public pluginCode(MapWindow.Interfaces.IMapWin MapWin)
 {
     _mapWin = MapWin;
 }
        //  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");
        }