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

OnCurrentDateTimeChanged() public static method

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

            t = d as TimelineTray;

            if (t != null && e.NewValue != e.OldValue)
            {
                if ((DateTime) e.NewValue < t.MinDateTime)
                {
                    t.SetValue(CurrentDateTimeProperty, t.MinDateTime);
                }
                else if ((DateTime) e.NewValue > t.MaxDateTime)
                {
                    t.SetValue(CurrentDateTimeProperty, t.MaxDateTime);
                }
                else 
                {
                    t.m_currentDateTime = (DateTime) e.NewValue;
                    if (t.m_mainBand != null)
                    {
                        t.m_mainBand.CurrentDateTime = t.m_currentDateTime;
                        t.m_currentDateTime = t.m_mainBand.CurrentDateTime;
                    }
                    
                }
            }
        }