private void ExecuteAfterPopulateSection() { try { ActionRunner runner = new ActionRunner(); Core.Action action = null; if (Section is DetailsSection) { if (DetailsSection.AfterPopulateSection != null) { action = ObjectCopier.Clone <Core.Action>(DetailsSection.AfterPopulateSection); } } if (Section is EditSection) { action = ObjectCopier.Clone <Core.Action>(EditSection.AfterPopulateSection); } if (action != null) { runner.Page = (BasePage)this.Page; runner.Action = action; runner.Execute(); } } catch (Exception ex) { throw ex; } }
void ctrl_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (Me.SelectedIndexChanged != null) { ActionRunner runner = new ActionRunner(); Core.Action action = ObjectCopier.Clone <Core.Action>(Me.SelectedIndexChanged); runner.Page = (BasePage)this.Page; runner.Action = action; runner.Execute(); } } catch (Exception ex) { string ErrorMessageFormat = "ERROR - {0} - Control {1} ({2} - {3})"; string ErrorMessages = String.Format(ErrorMessageFormat, ex.Message, this.ControlID, Me.Type, this.ID); this.ctrl.Items.Insert(0, new RadComboBoxItem(ErrorMessages, String.Empty)); this.ctrl.BackColor = Color.Red; } }
public override void OnLateExecute() { if (m_SelectedAction.Execute() == Result.Over) { m_Runner.SetCurrentState((int)RunSingleTurnState.Resolve, "action is over"); } }
public virtual void ExecuteAction(CodeTorch.Core.Action sourceAction) { if (sourceAction != null) { ActionRunner runner = new ActionRunner(); Core.Action action = ObjectCopier.Clone <Core.Action>(sourceAction); runner.Page = (BasePage)this.Page; runner.Action = action; runner.Execute(); } }
void button_Click(object sender, EventArgs e) { log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); try { ActionRunner runner = new ActionRunner(); Core.Action action = ObjectCopier.Clone <Core.Action>(Me.OnClick); if (action != null) { runner.Page = (BasePage)this.Page; runner.Action = action; runner.Execute(); } } catch (Exception ex) { log.Error(ex); ((BasePage)this.Page).DisplayErrorAlert(ex); } }
void button_Click(object sender, EventArgs e) { log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); try { //find specified button by name string buttonID = ((System.Web.UI.WebControls.Button)sender).ID; CodeTorch.Core.ButtonControl button = Me.Buttons.Where(x => x.Name.ToLower() == buttonID.ToLower()).SingleOrDefault(); if (button != null) { //button was found...so call any commands it may have tied to this action ActionRunner runner = new ActionRunner(); Core.Action action = ObjectCopier.Clone <Core.Action>(button.OnClick); if (action != null) { runner.Page = (BasePage)this.Page; runner.Action = action; runner.Execute(); } } } catch (Exception ex) { log.Error(ex); page.DisplayErrorAlert(ex); } }