Beispiel #1
0
        public Main()
        {
            InitializeComponent();

            windowsServices = new WindowsServices();

            BuildForm();
        }
        public AddService()
        {
            InitializeComponent();
            windowsServices = new WindowsServices();

            var allServices = windowsServices.GetWindowsServices();
            var configuredServiceNames = new WindowsServices().GetConfiguredServices().Select(x => x.ServiceName).ToList();

            allServices = allServices.Where(x => !configuredServiceNames.Contains(x.ServiceName));
            cbServices.DataSource = allServices.OrderBy(x => x.DisplayName).ToList();
            cbServices.DisplayMember = "DisplayName";
            cbServices.SelectedIndex = 0;
        }