using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
namespace JJServiceManager
{
/// 추가 선택 화면: Windows 서비스 전체 목록에서 관리할 서비스를 고름
public sealed class ServicePickerWindow : Window
{
private readonly HashSet _registered;
private readonly DataGrid _grid;
private readonly TextBox _search;
private readonly CheckBox _onlySelected;
private readonly TextBlock _loading;
private readonly TextBlock _status;
private List _all = new List();
private ICollectionView _view;
/// 선택완료 시 체크된 서비스 (순서: 이름순)
public List Result { get; private set; }
public ServicePickerWindow(IEnumerable registeredNames)
{
_registered = new HashSet(registeredNames, StringComparer.OrdinalIgnoreCase);
Title = "추가 선택 화면 - 서비스 선택";
Width = 1100;
Height = 700;
MinWidth = 700;
MinHeight = 400;
FontFamily = new FontFamily("Malgun Gothic");
FontSize = 13;
Background = Brushes2.Make("#FAFAFA");
WindowStartupLocation = WindowStartupLocation.CenterOwner;
ShowInTaskbar = false;
AppIcon.Apply(this);
var root = XamlLoader.LoadElement("ServicePicker.xaml");
Content = root;
_grid = root.Find("grid");
_search = root.Find("txtSearch");
_onlySelected = root.Find("chkOnlySelected");
_loading = root.Find("txtLoading");
_status = root.Find("txtStatus");
root.Find