Exemplo n.º 1
0
        void command_Terminate()
        {
            this.Do(frm =>
            {
                frm.HandleCommandTerminate();
            });

            _mouse       = null;
            _command     = null;
            _application = null;
        }
Exemplo n.º 2
0
 private void ConnectMouse()
 {
     _cmd   = (SolidEdgeFramework.Command)_application.CreateCommand((int)SolidEdgeConstants.seCmdFlag.seNoDeactivate);
     _mouse = (SolidEdgeFramework.Mouse)_cmd.Mouse;
     _cmd.Start();
     _mouse.EnabledMove = true;
     _mouse.LocateMode  = (int)SolidEdgeConstants.seLocateModes.seLocateSimple;
     _mouse.ScaleMode   = 1; // Design model coordinates.
     _mouse.WindowTypes = 1; // Graphic window's only.
     _mouse.AddToLocateFilter(32);
     _connectionPointController.AdviseSink <SolidEdgeFramework.ISEMouseEvents>(_mouse);
 }
Exemplo n.º 3
0
        private void buttonStartCommand_Click(object sender, EventArgs e)
        {
            try
            {
                _application        = SolidEdgeCommunity.SolidEdgeUtils.Connect();
                _command            = _application.CreateCommand((int)SolidEdgeConstants.seCmdFlag.seNoDeactivate);
                _command.Terminate += command_Terminate;
                _command.Start();
                _mouse             = _command.Mouse;
                _mouse.LocateMode  = comboBoxLocateModes.SelectedIndex;
                _mouse.EnabledMove = (bool)comboBoxEnableMouseMoveEvent.SelectedItem;
                _mouse.ScaleMode   = 1; // Design model coordinates.
                _mouse.WindowTypes = 1; // Graphic window's only.

                foreach (ListViewItem listViewItem in listViewFilters.CheckedItems)
                {
                    int filter = (int)listViewItem.Tag;
                    _mouse.AddToLocateFilter(filter);
                }

                _mouse.MouseDown += mouse_MouseDown;
                _mouse.MouseMove += mouse_MouseMove;

                outputTextBox.Clear();
                comboBoxEnableMouseMoveEvent.Enabled = false;
                buttonStopCommand.Enabled            = true;
                buttonStartCommand.Checked           = true;
                buttonStartCommand.Enabled           = false;
                comboBoxLocateModes.Enabled          = false;
                listViewFilters.Enabled = false;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 4
0
        private void buttonStartCommand_Click(object sender, EventArgs e)
        {
            try
            {
                _application = SolidEdgeCommunity.SolidEdgeUtils.Connect();
                _command = _application.CreateCommand((int)SolidEdgeConstants.seCmdFlag.seNoDeactivate);
                _command.Terminate += command_Terminate;
                _command.Start();
                _mouse = _command.Mouse;
                _mouse.LocateMode = comboBoxLocateModes.SelectedIndex;
                _mouse.EnabledMove = (bool)comboBoxEnableMouseMoveEvent.SelectedItem;
                _mouse.ScaleMode = 1;   // Design model coordinates.
                _mouse.WindowTypes = 1; // Graphic window's only.

                foreach (ListViewItem listViewItem in listViewFilters.CheckedItems)
                {
                    int filter = (int)listViewItem.Tag;
                    _mouse.AddToLocateFilter(filter);
                }

                _mouse.MouseDown += mouse_MouseDown;
                _mouse.MouseMove += mouse_MouseMove;

                outputTextBox.Clear();
                comboBoxEnableMouseMoveEvent.Enabled = false;
                buttonStopCommand.Enabled = true;
                buttonStartCommand.Checked = true;
                buttonStartCommand.Enabled = false;
                comboBoxLocateModes.Enabled = false;
                listViewFilters.Enabled = false;
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 5
0
        void command_Terminate()
        {
            this.Do(frm =>
            {
                frm.HandleCommandTerminate();
            });

            _mouse = null;
            _command = null;
            _application = null;
        }