/// <summary> /// Set data into the command. /// </summary> public void Make(ModelessCommandData commandData) { lock (this) { m_data = commandData; } }
private void RaisePrintSummaryCommand() { ModelessCommandData data = new ModelessCommandData(); data.CommandType = ModelessCommandType.PrintMainPageStatistics; ThisApplication.thisApp.GetDockableAPIUtility().RunModelessCommand(data); m_exEvent.Raise(); }
/// <summary> /// Called to execute an API command and update the UI after the command is finished. /// </summary> public void Execute(UIApplication app) { ModelessCommandData data = ThisApplication.thisApp.GetDockableAPIUtility().ModelessCommand.Take(); ThisApplication.thisApp.GetDockableAPIUtility().RunModelessCommand(data); ThisApplication.thisApp.GetMainWindow().UpdateUI(ThisApplication.thisApp.GetDockableAPIUtility().ModelessCommand.Take()); ThisApplication.thisApp.GetMainWindow().WakeUp(); }
private void RaisePrintSpecificSummaryCommand(string guid) { ModelessCommandData data = new ModelessCommandData(); data.CommandType = ModelessCommandType.PrintSelectedPageStatistics; data.SelectedPaneId = guid; ThisApplication.thisApp.GetDockableAPIUtility().RunModelessCommand(data); m_exEvent.Raise(); }
public void UpdateUI(ModelessCommandData data) { switch (data.CommandType) { case (ModelessCommandType.PrintMainPageStatistics): { Log.Message("***Main Pane***"); Log.Message(data.WindowSummaryData); break; } case (ModelessCommandType.PrintSelectedPageStatistics): { Log.Message("***Selected Pane***"); Log.Message(data.WindowSummaryData); break; } default: break; } }
/// <summary> /// A method to examine an incoming command and start the process of executing /// safely in the Idle() or ExternalEvent() loop. /// </summary> public void RunModelessCommand(ModelessCommandData command) { switch (command.CommandType) { case ModelessCommandType.PrintMainPageStatistics: { // command.WindowSummaryData = // GetPaneSummary(ThisApplication.thisApp.MainPageDockablePaneId); ModelessCommand.Make(command); break; } case ModelessCommandType.PrintSelectedPageStatistics: { command.WindowSummaryData = GetPaneSummary(command.SelectedPaneId); ModelessCommand.Make(command); break; } default: break; } }