protected override async Task <ActionModelBase> GetActionInternal() { if (this.ShowUsernameGrid) { return(TwitchActionModel.CreateUserAction(this.SelectedActionType, this.Username)); } else if (this.ShowAdGrid) { return(TwitchActionModel.CreateAdAction(this.SelectedAdLength)); } else if (this.ShowClipsGrid) { return(TwitchActionModel.CreateClipAction(this.ClipIncludeDelay, this.ShowInfoInChat)); } else if (this.ShowStreamMarkerGrid) { return(TwitchActionModel.CreateStreamMarkerAction(this.StreamMarkerDescription, this.ShowInfoInChat)); } else if (this.ShowUpdateChannelPointRewardGrid) { return(TwitchActionModel.CreateUpdateChannelPointReward(this.ChannelPointReward.id, this.ChannelPointRewardState, this.ChannelPointRewardCost, this.ChannelPointRewardUpdateCooldownsAndLimits, this.ChannelPointRewardMaxPerStream, this.ChannelPointRewardMaxPerUser, this.ChannelPointRewardGlobalCooldown)); } else if (this.ShowPollGrid) { List <string> choices = new List <string>(); if (!string.IsNullOrEmpty(this.PollChoice1)) { choices.Add(this.PollChoice1); } if (!string.IsNullOrEmpty(this.PollChoice2)) { choices.Add(this.PollChoice2); } if (!string.IsNullOrEmpty(this.PollChoice3)) { choices.Add(this.PollChoice3); } if (!string.IsNullOrEmpty(this.PollChoice4)) { choices.Add(this.PollChoice4); } return(TwitchActionModel.CreatePollAction(this.PollTitle, this.PollDurationSeconds, this.pollChannelPointsCost, this.pollBitsCost, choices, await this.ActionEditorList.GetActions())); } else if (this.ShowPredictionGrid) { return(TwitchActionModel.CreatePredictionAction(this.PredictionTitle, this.PredictionDurationSeconds, new List <string>() { this.PredictionOutcome1, this.PredictionOutcome2 }, await this.ActionEditorList.GetActions())); } return(null); }
protected override Task <ActionModelBase> GetActionInternal() { if (this.ShowUsernameGrid) { return(Task.FromResult <ActionModelBase>(TwitchActionModel.CreateUserAction(this.SelectedActionType, this.Username))); } else if (this.ShowAdGrid) { return(Task.FromResult <ActionModelBase>(TwitchActionModel.CreateAdAction(this.SelectedAdLength))); } else if (this.ShowClipsGrid) { return(Task.FromResult <ActionModelBase>(TwitchActionModel.CreateClipAction(this.ClipIncludeDelay, this.ShowInfoInChat))); } else if (this.ShowStreamMarkerGrid) { return(Task.FromResult <ActionModelBase>(TwitchActionModel.CreateStreamMarkerAction(this.StreamMarkerDescription, this.ShowInfoInChat))); } return(Task.FromResult <ActionModelBase>(null)); }