Beispiel #1
0
        /// <summary>
        /// Handle the Inherits changing.
        /// </summary>
        /// <param name="sender">The PaymentScheduleControl that owns the property.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private static void OnInheritsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
        {
            PaymentScheduleControl schedule = sender as PaymentScheduleControl;

            if (schedule.Inherits)
            {
                FluidTrade.Core.ThreadPoolHelper.QueueUserWorkItem(delegate(object data)
                {
                    lock (DataModel.SyncRoot)
                        schedule.Dispatcher.BeginInvoke(
                            new WaitCallback(cs => schedule.SetInheritedSchedule(cs as CommissionSchedule)),
                            DispatcherPriority.Normal,
                            new object[] { Blotter.GetEffectiveCommissionSchedule((Guid)data) });
                },
                                                                   schedule.Entity.EntityId);
            }
            else
            {
                if (schedule.Entity.CommissionSchedule == null)
                {
                    schedule.Entity.CommissionSchedule = new CommissionSchedule();
                }
                schedule.content.DataContext = schedule.Entity.CommissionSchedule;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handle the CommissionSchedule changing.
        /// </summary>
        /// <param name="sender">The PaymentScheduleControl that owns the property.</param>
        /// <param name="eventArgs">The event arguments.</param>
        private static void OnEntityChanged(DependencyObject sender, DependencyPropertyChangedEventArgs eventArgs)
        {
            PaymentScheduleControl schedule = sender as PaymentScheduleControl;

            FluidTrade.Core.ThreadPoolHelper.QueueUserWorkItem(data => schedule.CanInherit(data as Entity), schedule.Entity.Clone());

            if (schedule.Entity.CommissionSchedule != null)
            {
                schedule.Inherits            = false;
                schedule.content.DataContext = schedule.Entity.CommissionSchedule;
            }
            else
            {
                schedule.Inherits = true;
            }
        }