void command_Terminate() { this.Do(frm => { frm.HandleCommandTerminate(); }); _mouse = null; _command = null; _application = null; }
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); }
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); } }
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); } }
/// <summary> /// Returns the locate mode for the referenced object. /// </summary> /// <param name="mouse"></param> /// <param name="mode"></param> /// <returns></returns> public static SolidEdgeConstants.seLocateModes GetLocateMode(this SolidEdgeFramework.Mouse mouse, SolidEdgeConstants.seLocateModes mode) { return((SolidEdgeConstants.seLocateModes)mouse.LocateMode); }
/// <summary> /// Sets the locate mode for the referenced object. /// </summary> /// <param name="mouse"></param> /// <param name="mode"></param> public static void SetLocateMode(this SolidEdgeFramework.Mouse mouse, SolidEdgeConstants.seLocateModes mode) { mouse.LocateMode = (int)mode; }
/// <summary> /// Specifies what types of objects the Mouse can locate. /// </summary> /// <param name="mouse"></param> /// <param name="filter"></param> public static void AddToLocateFilter(this SolidEdgeFramework.Mouse mouse, SolidEdgeConstants.seLocateFilterConstants filter) { mouse.AddToLocateFilter((int)filter); }
void command_Terminate() { this.Do(frm => { frm.HandleCommandTerminate(); }); _mouse = null; _command = null; _application = null; }