/// <summary> /// Initializes a new instance of the <see cref="RouteEditMachineState{ViewModelContextType}"/> class. /// </summary> internal RouteEditMachineState() { m_ButtonsTemplate = new CancelTemplate(Resources.UpdateRoutesButtonTitle, Resources.ImportXMLButtonTitle, Resources.SetupButtonTitle); m_StateMachineActionsArray = new Action <object> [4]; m_StateMachineActionsArray[(int)m_ButtonsTemplate.CancelPosition] = x => this.Cancel(); m_StateMachineActionsArray[(int)StateMachineEventIndex.RightMiddleButtonEvent] = x => this.OnSetupButton(); m_StateMachineActionsArray[(int)StateMachineEventIndex.LeftButtonEvent] = x => this.OnUpdateRoutesButton(); m_StateMachineActionsArray[(int)StateMachineEventIndex.LeftMiddleButtonEvent] = x => this.OnReadXMLFileButton(); }
/// <summary> /// Initializes a new instance of the <see cref="ArchivingMachineState{ViewModelContextType}"/> class. /// </summary> internal ArchivingMachineState() { m_ButtonsTemplate = new CancelTemplate(String.Empty, Resources.ArchiveButtonTitle, Resources.SetupButtonTitle); m_StateMachineActionsArray = new Action <object> [4]; m_StateMachineActionsArray[(int)m_ButtonsTemplate.CancelPosition] = x => this.Cancel(); m_StateMachineActionsArray[(int)StateMachineEventIndex.RightMiddleButtonEvent] = x => this.OnSetupButton(); m_StateMachineActionsArray[(int)StateMachineEventIndex.LeftMiddleButtonEvent] = x => this.OnArchiveButton(); m_StateMachineActionsArray[(int)StateMachineEventIndex.LeftButtonEvent] = x => { }; }
public void CreateCancelTemplate() { CancelTemplate _template = new CancelTemplate(String.Empty, String.Empty, String.Empty); AssertOnlyCancel(_template); _template.OnlyCancel(); AssertOnlyCancel(_template); _template.RevertChanges(); AssertOnlyCancel(_template); }
private static void AssertOnlyCancel(CancelTemplate _template) { Assert.AreEqual <StateMachineEvents>(StateMachineEvents.RightButtonEvent, _template.GetEnabledEvents); Assert.AreEqual <Visibility>(Visibility.Visible, _template.RightButtonVisibility); }