コード例 #1
0
        private void ComboVolumeControlMode_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            List <ToastifyVolumeControlMode> currentItems = e.AddedItems.Cast <EnumComboBoxItem>()
                                                            .Select(it => (ToastifyVolumeControlMode)it.Value).ToList();

            if (!currentItems.Any())
            {
                return;
            }

            ToastifyVolumeControlMode current = currentItems.First();

            this.PanelWindowsMixerIncrement.IsEnabled = current == ToastifyVolumeControlMode.SystemSpotifyOnly;
        }
コード例 #2
0
        public override void PerformAction()
        {
            ToastifyVolumeControlMode mode = this.GetVolumeControlMode();

            switch (mode)
            {
            case ToastifyVolumeControlMode.SystemGlobal:
                this.PerformSystemGlobalAction();
                break;

            case ToastifyVolumeControlMode.SystemSpotifyOnly:
                this.PerformSystemSpotifyOnlyAction();
                break;

            default:
                this.RaiseActionFailed(this, new ActionFailedEventArgs($"Unhandled {nameof(ToastifyVolumeControlMode)} value: {mode}"));
                throw new ArgumentOutOfRangeException();
            }
        }