private void tbVLoop_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { try { if (e.Button == this.btnBack) { _app.MovePrevView(); } else if (e.Button == this.btnForward) { _app.MoveNextView(); } else { VLoopCommand cmd = (VLoopCommand)e.Button.Tag; cmd.Execute(); } } catch { MessageBox.Show("Unable to perfom requested action", "VLoop error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnMenuClick(object sender, System.EventArgs e) { try { //the key is either an action or an IViewExplorer. object key = ((AfniMenuItem)sender).Key; VLoopCommand cmd = key as VLoopCommand; if (cmd != null) { cmd.Execute( ); } else { IViewExplorer explorer = key as IViewExplorer; if (explorer != null) { _app.LoadExplorer(explorer); } } } catch { MessageBox.Show("Unable to perform action.", "VLoop Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void OnViewTaskClicked(object sender, EventArgs e) { ActionTypes key = (ActionTypes)((AfniLink)sender).Tag; VLoopCommand cmd = (VLoopCommand)_app.Commands[key]; cmd.Execute(); }