コード例 #1
0
        public bool IsAvailable()
        {
            BannerManager.Setup();

            // Available in all Windows versions
            return(true);
        }
コード例 #2
0
        public SoundSwitchApplicationContext()
        {
            BannerManager.Setup();
            var deviceActiveLister          = new CachedAudioDeviceLister(DeviceState.Active);
            var deviceUnpluggedActiveLister = new CachedAudioDeviceLister(DeviceState.Active | DeviceState.Unplugged);

            deviceActiveLister.Refresh();
            deviceUnpluggedActiveLister.Refresh();

            AppModel.Instance.ActiveAudioDeviceLister    = deviceActiveLister;
            AppModel.Instance.ActiveUnpluggedAudioLister = deviceUnpluggedActiveLister;

            AppModel.Instance.TrayIcon = new TrayIcon();
            AppModel.Instance.InitializeMain();
            AppModel.Instance.NewVersionReleased += (sender, @event) =>
            {
                if (@event.UpdateMode == UpdateMode.Silent)
                {
                    new AutoUpdater("/VERYSILENT", ApplicationPath.Default).Update(
                        @event.Release, true);
                }
            };


            if (AppConfigs.Configuration.FirstRun)
            {
                AppModel.Instance.TrayIcon.ShowSettings();
                AppConfigs.Configuration.FirstRun = false;
                Log.Information("First run");
            }
        }