private void GetAllServices()
        {
            allServices     = ServiceController.GetServices();
            allServicesList = new List <ServiceStruct>();

            foreach (ServiceController sc in allServices)
            {
                if (btnFilter.IsChecked == true)
                {
                    int isContains = 0;
                    foreach (string arg in filter)
                    {
                        if (string.IsNullOrWhiteSpace(arg))
                        {
                            continue;
                        }
                        if (sc.DisplayName.ToLower().Contains(arg))
                        {
                            isContains++;
                        }
                    }
                    if (isContains == 0)
                    {
                        continue;
                    }
                }

                ServiceStruct ss = new ServiceStruct();

                ss.name   = sc.ServiceName;
                ss.status = sc.Status;

                ss.Name   = sc.DisplayName;
                ss.Status = ss.GetDisplayName(sc.Status);

                allServicesList.Add(ss);
            }

            lv.ItemsSource = allServicesList;
            txtNum.Text    = "服务个数:" + allServicesList.Count.ToString();
        }
        private void GetAllServices()
        {
            allServices = ServiceController.GetServices();
            allServicesList = new List<ServiceStruct>();

            foreach (ServiceController sc in allServices)
            {
                if (btnFilter.IsChecked == true)
                {
                    int isContains = 0;
                    foreach (string arg in filter)
                    {
                        if (string.IsNullOrWhiteSpace(arg)) continue;
                        if (sc.DisplayName.ToLower().Contains(arg))
                            isContains++;
                    }
                    if (isContains == 0) continue;
                }

                ServiceStruct ss = new ServiceStruct();

                ss.name = sc.ServiceName;
                ss.status = sc.Status;

                ss.Name = sc.DisplayName;
                ss.Status = ss.GetDisplayName(sc.Status);

                allServicesList.Add(ss);
            }

            lv.ItemsSource = allServicesList;
            txtNum.Text = "服务个数:" + allServicesList.Count.ToString();
        }