示例#1
0
        private static void ServerOSPropertyChanced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            menuButton but = (menuButton)d;

            switch (but.ServerOS)
            {
            case "Win2012":
                but.ledbutton.Fill        = Brushes.Green;
                but.buttonMenu.Background = Brushes.LightGreen;
                break;

            case "Win2008":
                but.ledbutton.Fill        = Brushes.Green;
                but.buttonMenu.Background = Brushes.LightBlue;
                break;

            case "Win2003":
                but.ledbutton.Fill        = Brushes.Green;
                but.buttonMenu.Background = Brushes.Red;
                break;

            case "Win7":
                but.ledbutton.Fill        = Brushes.Green;
                but.buttonMenu.Background = Brushes.Yellow;
                break;

            case "freeBSD":
                but.ledbutton.Fill        = Brushes.Green;
                but.buttonMenu.Background = Brushes.PaleGoldenrod;
                break;

            default:
                break;
            }
        }
示例#2
0
        private static void ServerNamePropertyChanced(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            menuButton but = (menuButton)d;

            if (!(but.ServerName == null))
            {
                but.buttonMenu.Content   = but.ServerName;
                but.ledbutton.Visibility = System.Windows.Visibility.Hidden;
            }
        }