Exemplo n.º 1
0
        private void Enable_Click(object sender, RoutedEventArgs e)
        {
            var updateService = new CommandLineUpdateService();

            updateService.EnableUpdates();
            UpdateServiceStateLabel();
        }
Exemplo n.º 2
0
        public void UpdateServiceStateLabel()
        {
            var updateService = new CommandLineUpdateService();
            var serviceState  = updateService.GetServiceState(StaticConfigurationManager.GetValue("UpdateServiceName"));

            ServiceStatusLabel.Text = Enum.GetName(typeof(CommandLineUpdateService.StartupState), serviceState);
            if (serviceState == CommandLineUpdateService.StartupState.Disabled)
            {
                ServiceStatusIcon.Kind       = PackIconKind.Alert;
                ServiceStatusIcon.Foreground = ConvertFromHexToBrush("#AD1457");
            }
            else
            {
                ServiceStatusIcon.Kind       = PackIconKind.CheckboxMarkedCircle;
                ServiceStatusIcon.Foreground = ConvertFromHexToBrush("#00BCD4");
            }
        }