public ServiceTray()
        {
            icon = new NotifyIcon()
            {
                Icon             = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location),
                ContextMenuStrip = new ContextMenuStrip()
                {
                    Visible = true
                },
                Visible = true
            };
            icon.ContextMenuStrip.Items.Add("Exit", null, (sender, e) => Exit());
            icon.ContextMenuStrip.Items.Add("Open Configurator", null, (sender, e) => OpenConfigurator());
            icon.ShowBalloonTip(5000, "Welcome", "Welcome to AirPodsUI, to exit, click on the system tray icon.", ToolTipIcon.Info);

            json = PairedDevicesJson.FromJson(File.ReadAllText(Helper.PairedDevicesFile));

            Setup();

            newU = DeviceSearcher.Search();
            old  = DeviceSearcher.Search();

            timer          = new Timer();
            timer.Interval = 500;
            timer.Tick    += Timer_Tick;
            timer.Start();
        }
Beispiel #2
0
 public static string ToJson(this PairedDevicesJson self)
 {
     return(JsonConvert.SerializeObject(self, AirPodsUI.Service.PDConverter.Settings));
 }