Ejemplo n.º 1
0
        private static void IsBuildingChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
        {
            NotificationBar notificationBar = dependencyObject as NotificationBar;

            if (notificationBar == null || !(args.Property.Name == "IsBuilding"))
            {
                return;
            }
            bool flag1 = (bool)args.OldValue;
            bool flag2 = (bool)args.NewValue;

            if (flag2 == flag1)
            {
                return;
            }
            if (flag2)
            {
                notificationBar.timer.Stop();
                notificationBar.IsOpen = flag2;
            }
            else
            {
                notificationBar.timer.Interval = new TimeSpan(0, 0, notificationBar.CloseDelay);
                notificationBar.timer.Start();
            }
        }
Ejemplo n.º 2
0
        private static void IsBuildingChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
        {
            NotificationBar timeSpan = dependencyObject as NotificationBar;

            if (timeSpan != null && args.Property.Name == "IsBuilding")
            {
                bool oldValue = (bool)args.OldValue;
                bool newValue = (bool)args.NewValue;
                if (newValue != oldValue)
                {
                    if (newValue)
                    {
                        timeSpan.timer.Stop();
                        timeSpan.IsOpen = newValue;
                        return;
                    }
                    timeSpan.timer.Interval = new TimeSpan(0, 0, timeSpan.CloseDelay);
                    timeSpan.timer.Start();
                }
            }
        }