コード例 #1
0
        public static void NotifyWithSettings(this IManageToasts toasts, NotificationModel notification,
                                              ChannelSettingsModel.NotifyLevel notifyLevel)
        {
            switch (notifyLevel)
            {
            case ChannelSettingsModel.NotifyLevel.NoNotification:
                break;

            case ChannelSettingsModel.NotifyLevel.NotificationOnly:
                toasts.AddNotification(notification);
                break;

            case ChannelSettingsModel.NotifyLevel.NotificationAndToast:
                toasts.AddNotification(notification);
                toasts.FlashWindow();
                toasts.ShowToast();
                break;

            case ChannelSettingsModel.NotifyLevel.NotificationAndSound:
                toasts.AddNotification(notification);
                toasts.FlashWindow();
                toasts.PlaySound();
                toasts.ShowToast();
                break;
            }
        }
コード例 #2
0
ファイル: ListCommand.cs プロジェクト: ZornTaov/slimCat
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     if (ListArgument == ListKind.NotInterested)
     {
         return;
     }
     DoNormalToast(toastsManager);
 }
コード例 #3
0
ファイル: JoinCommand.cs プロジェクト: WreckedAvent/slimCat
        public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            var settings = chatState.GetChannelSettingsById(TargetChannelId);
            if (settings == null) return;

            var setting = new ChannelSettingPair(settings.JoinLeaveNotifyLevel,
                settings.JoinLeaveNotifyOnlyForInteresting);
            DoToast(setting, toastsManager, chatState);
        }
コード例 #4
0
ファイル: LogInCommand.cs プロジェクト: tecknojock/slimCat
        public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            if (!ApplicationSettings.ShowLoginToasts ||
                !chatState.IsInteresting(Model.TargetCharacter.Name) ||
                chatState.CharacterManager.IsOnList(Model.TargetCharacter.Name, ListKind.IgnoreUpdates, false))
            {
                return;
            }

            DoNormalToast(toastsManager);
        }
コード例 #5
0
ファイル: StatusCommand.cs プロジェクト: ZornTaov/slimCat
            public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
            {
                if (!ApplicationSettings.ShowStatusToasts
                    || !chatState.IsInteresting(Model.TargetCharacter.Name)
                    || chatState.CharacterManager.IsOnList(Model.TargetCharacter.Name, ListKind.IgnoreUpdates, false))
                {
                    return;
                }

                DoNormalToast(toastsManager);
            }
コード例 #6
0
        public virtual void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            if (!Model.TargetChannel.Settings.AlertAboutUpdates)
            {
                return;
            }

            SetToastData(toastsManager.Toast);
            toastsManager.AddNotification(Model);
            toastsManager.ShowToast();
        }
コード例 #7
0
        internal void DoToast(ChannelSettingPair setting, IManageToasts toastManager, IChatState chatState)
        {
            if (setting.OnlyForInteresting && !chatState.IsInteresting(Model.TargetCharacter.Name))
            {
                return;
            }

            toastManager.NotifyWithSettings(Model, setting.NotifyLevel);

            if (setting.NotifyLevel >= ChannelSettingsModel.NotifyLevel.NotificationAndToast)
            {
                SetToastData(toastManager.Toast);
            }
        }
コード例 #8
0
        public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            var settings = chatState.GetChannelSettingsById(TargetChannelId);

            if (settings == null)
            {
                return;
            }

            var setting = new ChannelSettingPair(settings.PromoteDemoteNotifyLevel,
                                                 settings.PromoteDemoteNotifyOnlyForInteresting);

            DoToast(setting, toastsManager, chatState);
        }
コード例 #9
0
ファイル: MessageCommand.cs プロジェクト: ZornTaov/slimCat
        public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            SetToastData(toastsManager.Toast);

            toastsManager.Toast.Title = Title;
            toastsManager.Toast.Navigator = new SimpleNavigator(chat =>
                chat.EventAggregator.GetEvent<RequestChangeTabEvent>().Publish(Channel.Id));
            toastsManager.Toast.Content = Context;

            toastsManager.AddNotification(Model);

            if (Channel.IsSelected)
            {
                if (ApplicationSettings.PlaySoundEvenWhenTabIsFocused)
                    toastsManager.PlaySound();
                return;
            }

            toastsManager.ShowToast();
            toastsManager.PlaySound();
            toastsManager.FlashWindow();
        }
コード例 #10
0
        public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            SetToastData(toastsManager.Toast);

            toastsManager.Toast.Title     = Title;
            toastsManager.Toast.Navigator = new SimpleNavigator(chat =>
                                                                chat.EventAggregator.GetEvent <RequestChangeTabEvent>().Publish(Channel.Id));
            toastsManager.Toast.Content = Context;

            toastsManager.AddNotification(Model);

            if (Channel.IsSelected)
            {
                if (ApplicationSettings.PlaySoundEvenWhenTabIsFocused)
                {
                    toastsManager.PlaySound();
                }
                return;
            }

            toastsManager.ShowToast();
            toastsManager.PlaySound();
            toastsManager.FlashWindow();
        }
コード例 #11
0
 internal void DoNormalToast(IManageToasts toastManager)
 {
     SetToastData(toastManager.Toast);
     toastManager.AddNotification(Model);
     toastManager.ShowToast();
 }
コード例 #12
0
 internal void DoLoudToast(IManageToasts toastManager)
 {
     DoNormalToast(toastManager);
     toastManager.PlaySound();
     toastManager.FlashWindow();
 }
コード例 #13
0
        public virtual void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
        {
            if (!Model.TargetChannel.Settings.AlertAboutUpdates) return;

            SetToastData(toastsManager.Toast);
            toastsManager.AddNotification(Model);
            toastsManager.ShowToast();
        }
コード例 #14
0
 public abstract void DisplayNewToast(IChatState chatState, IManageToasts toastsManager);
コード例 #15
0
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     DoLoudToast(toastsManager);
 }
コード例 #16
0
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     DoNormalToast(toastsManager);
 }
コード例 #17
0
 internal void DoLoudToast(IManageToasts toastManager)
 {
     DoNormalToast(toastManager);
     toastManager.PlaySound();
     toastManager.FlashWindow();
 }
コード例 #18
0
 internal void DoNormalToast(IManageToasts toastManager)
 {
     SetToastData(toastManager.Toast);
     toastManager.AddNotification(Model);
     toastManager.ShowToast();
 }
コード例 #19
0
 public abstract void DisplayNewToast(IChatState chatState, IManageToasts toastsManager);
コード例 #20
0
ファイル: ListCommand.cs プロジェクト: WreckedAvent/slimCat
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     if (ListArgument == ListKind.NotInterested) return;
     DoNormalToast(toastsManager);
 }
コード例 #21
0
        internal void DoToast(ChannelSettingPair setting, IManageToasts toastManager, IChatState chatState)
        {
            if (setting.OnlyForInteresting && !chatState.IsInteresting(Model.TargetCharacter.Name)) return;

            toastManager.NotifyWithSettings(Model, setting.NotifyLevel);

            if (setting.NotifyLevel >= ChannelSettingsModel.NotifyLevel.NotificationAndToast)
                SetToastData(toastManager.Toast);
        }
コード例 #22
0
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     Arguments.DisplayNewToast(chatState, toastsManager);
 }
コード例 #23
0
 public override void DisplayNewToast(IChatState chatState, IManageToasts toastsManager)
 {
     Arguments.DisplayNewToast(chatState, toastsManager);
 }