/// <summary> /// Initializes a new instance of the <see cref="MainPageData"/> class. /// </summary> private MainPageData() { b_SaveCommand = new CAS.Common.ViewModel.SynchronousCommandBase <Object>(x => SubmitChanges(), x => Modified && !ReadOnly); PagedCollectionView _npc = new PagedCollectionView(new DisposalRequestObservable()); RequestCollection = _npc; this.DisposalRequestObservable.ProgressChanged += DisposalRequestObservable_ProgressChanged; Log = "MainPageData created."; }
/// <summary> /// Initializes a new instance of the <see cref="ButtonsPanelBase"/> class. /// </summary> /// <param name="parentMachine">The parent machine.</param> /// <exception cref="System.ArgumentNullException">parentViewMode</exception> public ButtonsPanelBase(StateMachineContext parentMachine) { if (parentMachine == null) { throw new ArgumentNullException("parentViewMode"); } m_ParentViewMode = parentMachine; parentMachine.PropertyChanged += parentViewMode_PropertyChanged; LeftButtonCommand = new SynchronousCommandBase <object> (m_ParentViewMode.StateMachineActionsArray[(int)StateMachineEventIndex.LeftButtonEvent], y => (this.m_EnabledEvents & StateMachineEvents.LeftButtonEvent) != 0); LeftMiddleButtonCommand = new SynchronousCommandBase <object> (m_ParentViewMode.StateMachineActionsArray[(int)StateMachineEventIndex.LeftMiddleButtonEvent], y => (this.m_EnabledEvents & StateMachineEvents.LeftMiddleButtonEvent) != 0); RightMiddleButtonCommand = new SynchronousCommandBase <object> (m_ParentViewMode.StateMachineActionsArray[(int)StateMachineEventIndex.RightMiddleButtonEvent], y => (this.m_EnabledEvents & StateMachineEvents.RightMiddleButtonEvent) != 0); RightButtonCommand = new SynchronousCommandBase <object> (m_ParentViewMode.StateMachineActionsArray[(int)StateMachineEventIndex.RightButtonEvent], y => (this.m_EnabledEvents & StateMachineEvents.RightButtonEvent) != 0); }
/// <summary> /// Initializes a new instance of the <see cref="DisposalRequestDetails" /> class. Used to add new position of the requests list. /// </summary> /// <param name="parent">The parent.</param> /// <param name="account">The account without disposal created for the relevant request.</param> /// <param name="sequenceNumber">The sequence number that will be incremented each time new instance is created.</param> internal DisposalRequestDetails(DisposalRequest parent, CustomsWarehouse account, ref int sequenceNumber) { m_Parent = parent; m_Disposal = null; m_Account = account; AddedKg = 0; Batch = account.Batch; CustomsProcedure = parent.CustomsProcedure; DeclaredNetMass = 0; DocumentNumber = account.DocumentNo; MassPerPackage = account.CW_MassPerPackage.Value; PackagesToDispose = 0; QuantityyToClearSum = 0; QuantityyToClearSumRounded = 0; RemainingOnStock = account.TobaccoNotAllocated.Value; SequenceNumber = sequenceNumber++; SKU = account.SKU; SKUDescription = string.Empty; TotalStock = account.TobaccoNotAllocated.Value; Units = account.Units; MoveDown = new SynchronousCommandBase <Nullable <int> >(x => parent.GoDown(SequenceNumber), y => !parent.IsBottomActive(SequenceNumber)); MoveUp = new SynchronousCommandBase <Nullable <int> >(x => parent.GoUp(SequenceNumber), y => !parent.IsTopActive(SequenceNumber)); }