public Blacklist() { _handler = new Extensions.SpamProtection.Blacklist(); Words = new ObservableCollection <Core.Database.Storage.BlacklistedWords>(_handler.GetWords()); AddWordCommand = new Internal.RelayCommand(add => AddWord(), add => !string.IsNullOrEmpty(WordToAdd) && IsNotInList()); RemoveCommand = new Internal.RelayCommand(remove => Remove(), remove => SelectedWord != null); }
/// <summary> /// Set the Commands /// </summary> private void SetCommands() { SendMessageCommand = new Internal.RelayCommand(u => SendMessage(), s => Model.CanSendMessage); UnmuteCommand = new Internal.RelayCommand(um => UnmuteUser(), um => true); MuteCommand = new Internal.RelayCommand(um => MuteUser(), um => true); ModCommand = new Internal.RelayCommand(um => ModUser(), um => true); UnmodCommand = new Internal.RelayCommand(um => UnmodUser(), um => true); ShowUserInfo = new Internal.RelayCommand(u => ShowUserinfo(), u => true); }
public Streamgames() { BankheistOptionsWindow = new Internal.RelayCommand( bankheist => ShowBankheistOptions()); OpenWikiInBrowserBankheist = new Internal.RelayCommand( open => Extensions.SpamProtection.Caps.OpenWikiInBrowser()); _bankheistHandler = new Extensions.Streamgames.Bankheist.Handler(); }
public Songrequest() { Handler = new SongrequestHandler(); var type = new MetroContentControl().GetType(); AddCommand = new Internal.RelayCommand(add => AddSongToPlaylist(), add => !String.IsNullOrEmpty(AddYoutubeUrl) || !String.IsNullOrEmpty(AddPlaylistUrl)); PlaySongCommand = new Internal.RelayCommand(p => PlaySong(), p => Handler.Player.SongList.Any()); HonorRequesterCommand = new Internal.RelayCommand(h => HonorRequester(), p => Handler.Player.SelectedSong != null); DeleteCommand = new Internal.RelayCommand(d => DeleteSong(), d => Handler.Player.SelectedSong != null); }
private void SetupCommands() { RequestTwitchOAuthKeyCommand = new Internal.RelayCommand(t => RequestTwitchOAuthKey(), p => !String.IsNullOrEmpty(ClientID)); RequestGoogleAuthCommand = new Internal.RelayCommand(g => RequestGoogleAuth()); ConfirmCommand = new Internal.RelayCommand(c => Confirm(), c => !String.IsNullOrEmpty(OAuthKey) && !String.IsNullOrEmpty(Channel) && TwitchScopes != null && IsYoutubeAuthenticated && IsTwitchAuthenticated && !String.IsNullOrEmpty(BotName)); }
public Voting() { StartCommand = new Internal.RelayCommand( start => StartVoting(), start => _handler == null); StopCommand = new Internal.RelayCommand( stop => StopVoting(), stop => IsStarted); ResetCommand = new Internal.RelayCommand( reset => DoReset()); }
public Setup() { _authentication = new Core.Twitch.Authentication(); RequestOAuthTokenCommand = new Internal.RelayCommand( request => RequestOAuthToken(), request => !string.IsNullOrEmpty(TwitchClientID)); ConfirmCommand = new Internal.RelayCommand( confirm => ConfirmSetup(), confirm => _isTwitchAuthenticated); }
public Timers() { _handler = new Extensions.Timers.Handler(); TimersList = new ObservableCollection <Core.Database.Storage.Timers>(_handler.GetTimers()); AddCommand = new Internal.RelayCommand( add => ShowTimersOptionWindow(false)); EditCommand = new Internal.RelayCommand( edit => ShowTimersOptionWindow(true), edit => SelectedTimer != null); RemoveCommand = new Internal.RelayCommand( remove => RemoveSelectedTimer(), remove => SelectedTimer != null); }
public Streamgames() { BankheistOptionsWindow = new Internal.RelayCommand( bankheist => ShowBankheistOptions()); OpenWikiInBrowserBankheist = new Internal.RelayCommand( open => Extensions.SpamProtection.Caps.OpenWikiInBrowser()); _bankheistHandler = new Extensions.Streamgames.Bankheist.Handler(); _rouletteHandler = new Extensions.Streamgames.Roulette.Handler(); if (Config.Instance.Storage.StreamGames.Roulette.General.Active) { _rouletteHandler.StartRoulette(); } }
public Giveaway() { StartCommand = new Internal.RelayCommand( start => OpenOptionWindow(), start => _handler == null); StopCommand = new Internal.RelayCommand( stop => StopListining(), stop => IsStarted); TakeWinnerCommand = new Internal.RelayCommand( winner => _handler.GetWinner(), winner => _handler != null); ResetCommand = new Internal.RelayCommand( reset => DoReset(), reset => _handler != null); }
public SpamProtection() { CapsProtectionOptionsWindow = new Internal.RelayCommand( caps => ShowCapsOptions()); OpenWikiInBrowserCapsProtection = new Internal.RelayCommand( open => Extensions.SpamProtection.Caps.OpenWikiInBrowser()); LinksProtectionOptionsWindow = new Internal.RelayCommand( links => ShowLinksOptions()); OpenWikiInBrowserLinksProtection = new Internal.RelayCommand( open => Extensions.SpamProtection.Links.OpenWikiInBrowser()); BlacklistProtectionOptionsWindow = new Internal.RelayCommand( blacklist => OpenBlacklistOptions()); OpenWikiInBrowserBlacklistProtection = new Internal.RelayCommand( open => Extensions.SpamProtection.Blacklist.OpenWikiInBrowser()); }
public Chat() { _databaseChatHandler = new Core.Database.Handlers.Chat(); Messages = new ObservableCollection <Aiva.Models.Chat.Message>(); Viewer = new ObservableCollection <Aiva.Models.Chat.Viewer>(); Messages.CollectionChanged += MessageCountCheck; AivaClient.Instance.TwitchClient.OnMessageReceived += ChatMessageReceived; AivaClient.Instance.Tasks.OnModeratorsReceivedEvent += ModeratorsReceived; AivaClient.Instance.TwitchClient.OnUserLeft += RemoveViewerFromList; AivaClient.Instance.TwitchClient.OnUserJoined += AddViewerToList; AivaClient.Instance.TwitchClient.OnExistingUsersDetected += AddViewerToList; // commands SendMessageCommand = new Internal.RelayCommand( send => SendMessage(), send => !string.IsNullOrEmpty(MessageToSend)); MuteCommand = new Internal.RelayCommand( mute => AivaClient.Instance.TwitchClient.TimeoutUser( viewer: SelectedViewer.Name, duration: TimeSpan.FromMinutes(5), message: $"@{SelectedViewer.Name} muted through streamer!", dryRun: AivaClient.DryRun), mute => SelectedViewer != null); UnmuteCommand = new Internal.RelayCommand( unmute => AivaClient.Instance.TwitchClient.UnbanUser( viewer: SelectedViewer.Name, dryRun: AivaClient.DryRun), unmute => SelectedViewer != null); ModCommand = new Internal.RelayCommand( mod => AivaClient.Instance.TwitchClient.Mod(AivaClient.Instance.ChannelId, SelectedViewer.Name), mod => SelectedViewer != null); UnmodCommand = new Internal.RelayCommand( unmod => AivaClient.Instance.TwitchClient.Unmod(AivaClient.Instance.ChannelId, SelectedViewer.Name), unmod => SelectedViewer != null); }
public Songrequest() { _handler = new Extensions.Songrequest.Handler(); _handler.OnNewSong += AddNewSong; SongList = new ObservableCollection <Aiva.Models.Songrequest.Song>(); StartListenCommand = new Internal.RelayCommand( start => StartListen(), start => !IsListining && !string.IsNullOrEmpty(_handler.Properties?.Command)); StopListenCommand = new Internal.RelayCommand( stop => StopListen(), stop => IsListining); AddSongCommand = new Internal.RelayCommand( add => AddSong()); NextSongCommand = new Internal.RelayCommand( next => PlayNextSong(), next => SongList.Count > 1); OpenUrlCommand = new Internal.RelayCommand( open => Process.Start(new ProcessStartInfo(CurrentSong.Url)), open => CurrentSong != null); PlaySelectedSongCommand = new Internal.RelayCommand( play => PlaySelectedSong(), play => SelectedSong != null); ChangeSettingsCommand = new Internal.RelayCommand( edit => EditSongrequestSettings()); HonorRequesterCommand = new Internal.RelayCommand( honor => HonorRequester(), honor => CurrentSong != null); }
/// <summary> /// Init Commands /// </summary> private void SetCommands() { AddCommand = new Internal.RelayCommand(add => AddCommandToList(), add => !String.IsNullOrEmpty(AddModel.Name) && !String.IsNullOrEmpty(AddModel.Text)); ResetAddCommand = new Internal.RelayCommand(reset => AddModel = new Extensions.Models.Timers.AddModel(), add => true); DeleteCommand = new Internal.RelayCommand(d => Delete(), delete => Handler.SelectedTimer != null); }
/// <summary> /// Set the commands /// </summary> private void SetCommands() { SubmitCommand = new Internal.RelayCommand(submit => Submit()); }
public Dashboard() { AivaClient.Instance.TwitchClient.OnExistingUsersDetected += ExistingUsersDetected; SetCurrentViewersChart(); SetTotalFollowersChart(); IsOptionsStaticCurrentViewerActive = true; // default Games = new List <Aiva.Models.Dashboard.Streamgame>(); AivaClient.Instance.Tasks.Channel.OnNewStreamGame += (sender, e) => SelectedGame = Games.SingleOrDefault(g => string.Compare(g.Name, e) == 0) ?? default(Aiva.Models.Dashboard.Streamgame); AivaClient.Instance.Tasks.Channel.OnNewStreamTitle += (sender, e) => StreamTitle = e; AivaClient.Instance.Tasks.Channel.OnNewTotalFollower += (sender, e) => TotalFollowers = e; AivaClient.Instance.Tasks.Channel.OnNewTotalViews += (sender, e) => TotalViews = e; ChangeGameCommand = new Internal.RelayCommand( change => ChangeStreamTitleAndGame(), change => !string.IsNullOrEmpty(StreamTitle)); UpdateStreamTitleCommand = new Internal.RelayCommand( change => ChangeStreamTitleAndGame(), change => SelectedGame != null && !string.IsNullOrEmpty(StreamTitle)); ShowCommercialFlyoutCommand = new Internal.RelayCommand( show => ShowCommercialFlyout(), show => AivaClient.Instance.IsPartnered); // only possible when twitch partner //SlowModeOnCommand = new Internal.RelayCommand( // slowModeOn => AivaClient.Instance.Tasks.Channel.SetSlowMode(true, SlowModeValue)); //SlowModeOffCommand = new Internal.RelayCommand( // slowModeOn => AivaClient.Instance.Tasks.Channel.SetSlowMode(false)); //SubscriberOnlyOnCommand = new Internal.RelayCommand( // subOnlyOn => AivaClient.Instance.Tasks.Channel.SetSubMode(true)); //SubscriberOnlyOffCommand = new Internal.RelayCommand( // subOnlyOff => AivaClient.Instance.Tasks.Channel.SetSubMode(true)); //FollowersOnlyOnCommand = new Internal.RelayCommand( // followerOnlyOn => AivaClient.Instance.Tasks.Channel.SetFollowersMode(true)); Task.Factory.StartNew(async() => { var games = await AivaClient.Instance.TwitchApi.Games.v5.GetTopGamesAsync(100).ConfigureAwait(false); if (games?.Top != null) { foreach (var game in games.Top) { Games.Add( new Aiva.Models.Dashboard.Streamgame { GameId = game.Game.Id.ToString(), Name = game.Game.Name }); } SetStreamGame(); } }); SetViewsAndFollowers(); SetStreamTitle(); //SetSlowMode(); }