TrakHound_UI.Timeline.TimelineTray.OnMinDateTimeChanged C# (CSharp) Method

OnMinDateTimeChanged() public static method

public static OnMinDateTimeChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
d System.Windows.DependencyObject
e System.Windows.DependencyPropertyChangedEventArgs
return void
        public static void OnMinDateTimeChanged(
            DependencyObject                            d, 
            DependencyPropertyChangedEventArgs          e
        )
        {
            TimelineTray                                t;

            t = d as TimelineTray;

            if (t != null && e.NewValue != e.OldValue)
            {
                if ((DateTime) e.NewValue >= t.MaxDateTime)
                {
                    //throw new ArgumentOutOfRangeException("MinDateTime cannot be more then MaxDateTime");
                }
                else if (t.CurrentDateTime < (DateTime) e.NewValue)
                {
                    t.SetValue(CurrentDateTimeProperty, e.NewValue);
                }

                foreach (TimelineBand b in t.m_bands)
                {
                    if (b.Calculator != null && b.Calculator.Calendar != null)
                    {
                        b.Calculator.Calendar.MinDateTime = ((DateTime) e.NewValue);
                    }
                }
            }
        }