private void ButtonApply_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; REXCommand Cmd = new REXCommand(REXCommandType.OK); ThisExtension.Command(ref Cmd); }
private void ButtonClose_Click(object sender, RoutedEventArgs e) { REXCommand Cmd = new REXCommand(REXCommandType.Close); Cmd.CommandObject = false; ThisExtension.Command(ref Cmd); }
/// <summary> /// Commands the specified command struct. /// </summary> /// <param name="CommandStruct">The command struct.</param> /// <returns>Returns result of event operation.</returns> public override object OnCommand(ref REXCommand CommandStruct) { //Step 7.1.: Data exchange Dictionary <string, object> dictionary = CommandStruct.CommandObject as Dictionary <string, object>; if (dictionary != null) { try { Data.H = Convert.ToDouble(dictionary["H"]); Data.B = Convert.ToDouble(dictionary["B"]); Data.FamilySymbol = dictionary["FamilySymbol"].ToString(); ExtensionRef.OnRun(); return(true); } catch { return(false); } } else { return(base.OnCommand(ref CommandStruct)); } }
public override object OnCommand(ref REXCommand CommandStruct) { // insert code here. if (CommandStruct.Command == REXCommandType.Query) { if (CommandStruct.CommandObject.GetType().Equals(typeof(string))) { if ((string)CommandStruct.CommandObject == REXConst.RunContext.QueryUserInterface) { if (ThisApplication.Context2.Product.Type == REXInterfaceType.RCAD) { if (ThisExtension.ExtensionContext.Control.RunContext == REXConst.RunContext.RCadCreate || ThisExtension.ExtensionContext.Control.RunContext == REXConst.RunContext.RCadModify) { return(true); } else { return(false); } } return(null); // for standard run, for non standard must returns bool type. } } } return(null); }
private void ButtonClose_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; REXCommand Cmd = new REXCommand(REXCommandType.Close); Cmd.CommandObject = false; ThisExtension.Command(ref Cmd); }
private void REXExtensionWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { REXCommand Cmd = new REXCommand(REXCommandType.Close); Cmd.CommandObject = true; if (((bool)ThisExtension.Command(ref Cmd)) == true) { e.Cancel = false; } else { e.Cancel = true; } }
private void RunCommand(string Name) { REXCommand Cmd = null; switch (Name) { case "MenuItemOpen": case "ToolStripButtonOpen": case "ToolStripMenuItemOpen": ThisExtension.System.LoadFromFile(true); return; case "MenuItemSave": case "ToolStripButtonSave": case "ToolStripMenuItemSave": ThisExtension.System.SaveToFile(false, true); return; case "MenuItemSaveAs": case "ToolStripMenuItemSaveAs": ThisExtension.System.SaveToFile(true); return; case "MenuItemCalc": case "ToolStripButtonCalc": case "ToolStripMenuItemCalc": Cmd = new REXCommand(REXCommandType.Run); break; case "MenuItemHelpIndex": case "ToolStripButtonHelp": case "ToolStripMenuItemHelp": Cmd = new REXCommand(REXCommandType.Help); break; case "MenuItemClose": case "ToolStripMenuItemClose": Cmd = new REXCommand(REXCommandType.Close); break; case "MenuItemAbout": case "ToolStripMenuItemAbout": Cmd = new REXCommand(REXCommandType.About); break; } if (Cmd != null) { ThisExtension.Command(ref Cmd); } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { this.DialogResult = DialogResult.Cancel; REXCommand Cmd = new REXCommand(REXCommandType.Close); Cmd.CommandObject = true; if (((bool)ThisExtension.Command(ref Cmd)) == true) { e.Cancel = false; } else { e.Cancel = true; } }
private void RunCommand(string Name) { REXCommand Cmd = null; switch (Name) { case "Open": ThisExtension.System.LoadFromFile(true); return; case "Save": ThisExtension.System.SaveToFile(false, true); return; case "SaveAs": ThisExtension.System.SaveToFile(true); return; case "Calculate": Cmd = new REXCommand(REXCommandType.Run); break; case "Help": Cmd = new REXCommand(REXCommandType.Help); break; case "Close": Cmd = new REXCommand(REXCommandType.Close); break; case "About": Cmd = new REXCommand(REXCommandType.About); break; case "Preferences": ThisExtension.ShowPreferencesDialog(); break; } if (Cmd != null) { ThisExtension.Command(ref Cmd); } }
/// <summary> /// Commands the specified command struct. /// </summary> /// <param name="CommandStruct">The command struct.</param> /// <returns>Returns result of event operation.</returns> public override object OnCommand(ref REXCommand CommandStruct) { object result = null; if (ExtensionRef != null) { result = ExtensionRef.OnCommand(ref CommandStruct); } // insert code here. if (result == null) { return(base.OnCommand(ref CommandStruct)); } else { return(result); } }
public object Command(ref REXCommand CommandStruct) { return(this.ApplicationRef.Command(ref CommandStruct)); }
private void About_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { REXCommand Cmd = new REXCommand(REXCommandType.About); ThisExtension.Command(ref Cmd); }
private void ButtonApply_Click(object sender, RoutedEventArgs e) { REXCommand Cmd = new REXCommand(REXCommandType.OK); ThisExtension.Command(ref Cmd); }
private void HyperlinkAbout_Click(object sender, RoutedEventArgs e) { REXCommand Cmd = new REXCommand(REXCommandType.About); ThisExtension.Command(ref Cmd); }
public override object OnCommand(ref REXCommand CommandStruct) { // insert code here. return(null); }
//****************************************************************************************** /// <summary> /// Command handler /// </summary> public override object Command(ref REXCommand CommandStruct) { return(base.Command(ref CommandStruct)); }
/// <summary> /// Commands the specified command struct. /// </summary> /// <param name="CommandStruct">The command struct.</param> /// <returns>Returns result of event operation.</returns> public override object Command(ref REXCommand CommandStruct) { // insert code here. return(base.Command(ref CommandStruct)); }