Exemplo n.º 1
0
        private static void OnColorBusyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            led.ColorBusy = (Color)e.NewValue;
            if (led.IsActive && led.Flashing)
            {
                led.backgroundColor.Color = led.ColorBusy;
            }
        }
Exemplo n.º 2
0
        private static void OnColorOffPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            led.ColorOff = (Color)e.NewValue;
            if (led.IsActive == false)
            {
                led.backgroundColor.Color = led.ColorOff;
            }
        }
Exemplo n.º 3
0
        /**
         * Is active property chanced callback. If the led is no longer active, set color to null value
         * and stop timer.
         *
         */
        private static void IsActivePropertyChanced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            if (!led.IsActive)
            {
                //stop any running timer
                led.backgroundColor.Color = led.ColorOff;
                led.timer.Stop();
                led.timer.IsEnabled = false;
            }
            else
            {
                led.backgroundColor.Color = led.ColorOn;
            }
        }
Exemplo n.º 4
0
        private static void IsActivePropertyChanced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            if (led.IsActive == null)
            {
                led.backgroundColor.Color = led.ColorNull;
            }
            else if (led.IsActive == true)
            {
                led.backgroundColor.Color = led.ColorOn;
            }
            else
            {
                led.backgroundColor.Color = led.ColorOff;
            }
        }
Exemplo n.º 5
0
        private static void OnFlashingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            if (led.timer.IsEnabled)
            {
                led.timer.Stop();
                if (led.backgroundColor.Color == led.ColorNull)
                {
                    led.timer_Tick(null, new EventArgs());
                }
            }
            else
            {
                led.timer.Start();
            }
        }
Exemplo n.º 6
0
        private static void OnFlashingPeriodPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Led led = (Led)d;

            led.timer.Interval = TimeSpan.FromMilliseconds((int)e.NewValue);
        }
Exemplo n.º 7
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.led1 = ((LedControl.Led)(target));
                return;

            case 4:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.led2 = ((LedControl.Led)(target));
                return;

            case 6:
                this.label4 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.passwordBox1 = ((System.Windows.Controls.PasswordBox)(target));
                return;

            case 8:
                this.passwordEntered = ((System.Windows.Controls.Button)(target));

            #line 31 "..\..\MainWindow.xaml"
                this.passwordEntered.Click += new System.Windows.RoutedEventHandler(this.passwordEntered_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.version = ((System.Windows.Controls.Button)(target));

            #line 32 "..\..\MainWindow.xaml"
                this.version.Click += new System.Windows.RoutedEventHandler(this.version_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.Classify = ((System.Windows.Controls.Button)(target));

            #line 33 "..\..\MainWindow.xaml"
                this.Classify.Click += new System.Windows.RoutedEventHandler(this.Classify_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.ReClassify = ((System.Windows.Controls.Button)(target));

            #line 34 "..\..\MainWindow.xaml"
                this.ReClassify.Click += new System.Windows.RoutedEventHandler(this.Reclassify_click);

            #line default
            #line hidden
                return;

            case 12:
                this.QuickReClassify = ((System.Windows.Controls.Button)(target));

            #line 35 "..\..\MainWindow.xaml"
                this.QuickReClassify.Click += new System.Windows.RoutedEventHandler(this.QickClassify_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.Views = ((System.Windows.Controls.Grid)(target));
                return;

            case 14:
                this.DBErrorMsg = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 15:
                this.textBlock1 = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 8
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 2:
     this.label1 = ((System.Windows.Controls.Label)(target));
     return;
     case 3:
     this.led1 = ((LedControl.Led)(target));
     return;
     case 4:
     this.label2 = ((System.Windows.Controls.Label)(target));
     return;
     case 5:
     this.led2 = ((LedControl.Led)(target));
     return;
     case 6:
     this.label4 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.passwordBox1 = ((System.Windows.Controls.PasswordBox)(target));
     return;
     case 8:
     this.passwordEntered = ((System.Windows.Controls.Button)(target));
     
     #line 31 "..\..\MainWindow.xaml"
     this.passwordEntered.Click += new System.Windows.RoutedEventHandler(this.passwordEntered_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.version = ((System.Windows.Controls.Button)(target));
     
     #line 32 "..\..\MainWindow.xaml"
     this.version.Click += new System.Windows.RoutedEventHandler(this.version_Click);
     
     #line default
     #line hidden
     return;
     case 10:
     this.Classify = ((System.Windows.Controls.Button)(target));
     
     #line 33 "..\..\MainWindow.xaml"
     this.Classify.Click += new System.Windows.RoutedEventHandler(this.Classify_Click);
     
     #line default
     #line hidden
     return;
     case 11:
     this.ReClassify = ((System.Windows.Controls.Button)(target));
     
     #line 34 "..\..\MainWindow.xaml"
     this.ReClassify.Click += new System.Windows.RoutedEventHandler(this.Reclassify_click);
     
     #line default
     #line hidden
     return;
     case 12:
     this.QuickReClassify = ((System.Windows.Controls.Button)(target));
     
     #line 35 "..\..\MainWindow.xaml"
     this.QuickReClassify.Click += new System.Windows.RoutedEventHandler(this.QickClassify_Click);
     
     #line default
     #line hidden
     return;
     case 13:
     this.Views = ((System.Windows.Controls.Grid)(target));
     return;
     case 14:
     this.DBErrorMsg = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 15:
     this.textBlock1 = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }