public static void ReplaceActionGroupAction(List <ActionBase> actions) { for (int i = 0; i < actions.Count; i++) { ActionBase action = actions[i]; #pragma warning disable CS0612 // Type or member is obsolete if (action is ActionGroupAction) { ActionGroupAction aaction = (ActionGroupAction)action; actions[i] = new CommandAction() { CommandActionType = CommandActionTypeEnum.RunCommand, CommandID = aaction.ActionGroupID }; } #pragma warning restore CS0612 // Type or member is obsolete } }
private void ActionContentContainerControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { if (this.actionControl == null) { switch (this.type) { case ActionTypeEnum.Chat: this.actionControl = (this.action != null) ? new ChatActionControl((ChatAction)this.action) : new ChatActionControl(); break; case ActionTypeEnum.Currency: this.actionControl = (this.action != null) ? new CurrencyActionControl((CurrencyAction)this.action) : new CurrencyActionControl(); break; case ActionTypeEnum.ExternalProgram: this.actionControl = (this.action != null) ? new ExternalProgramActionControl((ExternalProgramAction)this.action) : new ExternalProgramActionControl(); break; case ActionTypeEnum.Input: this.actionControl = (this.action != null) ? new InputActionControl((InputAction)this.action) : new InputActionControl(); break; case ActionTypeEnum.Overlay: this.actionControl = (this.action != null) ? new OverlayActionControl((OverlayAction)this.action) : new OverlayActionControl(); break; case ActionTypeEnum.Sound: this.actionControl = (this.action != null) ? new SoundActionControl((SoundAction)this.action) : new SoundActionControl(); break; case ActionTypeEnum.Wait: this.actionControl = (this.action != null) ? new WaitActionControl((WaitAction)this.action) : new WaitActionControl(); break; case ActionTypeEnum.Counter: this.actionControl = (this.action != null) ? new CounterActionControl((CounterAction)this.action) : new CounterActionControl(); break; case ActionTypeEnum.GameQueue: this.actionControl = (this.action != null) ? new GameQueueActionControl((GameQueueAction)this.action) : new GameQueueActionControl(); break; case ActionTypeEnum.TextToSpeech: this.actionControl = (this.action != null) ? new TextToSpeechActionControl((TextToSpeechAction)this.action) : new TextToSpeechActionControl(); break; case ActionTypeEnum.WebRequest: this.actionControl = (this.action != null) ? new WebRequestActionControl((WebRequestAction)this.action) : new WebRequestActionControl(); break; case ActionTypeEnum.SpecialIdentifier: this.actionControl = (this.action != null) ? new SpecialIdentifierActionControl((SpecialIdentifierAction)this.action) : new SpecialIdentifierActionControl(); break; case ActionTypeEnum.File: this.actionControl = (this.action != null) ? new FileActionControl((FileAction)this.action) : new FileActionControl(); break; case ActionTypeEnum.Discord: this.actionControl = (this.action != null) ? new DiscordActionControl((DiscordAction)this.action) : new DiscordActionControl(); break; case ActionTypeEnum.Translation: this.actionControl = (this.action != null) ? new TranslationActionControl((TranslationAction)this.action) : new TranslationActionControl(); break; case ActionTypeEnum.Twitter: this.actionControl = (this.action != null) ? new TwitterActionControl((TwitterAction)this.action) : new TwitterActionControl(); break; case ActionTypeEnum.Conditional: this.actionControl = (this.action != null) ? new ConditionalActionControl((ConditionalAction)this.action) : new ConditionalActionControl(); break; case ActionTypeEnum.StreamingSoftware: this.actionControl = (this.action != null) ? new StreamingSoftwareActionControl((StreamingSoftwareAction)this.action) : new StreamingSoftwareActionControl(); break; case ActionTypeEnum.Streamlabs: this.actionControl = (this.action != null) ? new StreamlabsActionControl((StreamlabsAction)this.action) : new StreamlabsActionControl(); break; case ActionTypeEnum.Command: this.actionControl = (this.action != null) ? new CommandActionControl((CommandAction)this.action) : new CommandActionControl(); break; case ActionTypeEnum.Serial: this.actionControl = (this.action != null) ? new SerialActionControl((SerialAction)this.action) : new SerialActionControl(); break; case ActionTypeEnum.Moderation: this.actionControl = (this.action != null) ? new ModerationActionControl((ModerationAction)this.action) : new ModerationActionControl(); break; case ActionTypeEnum.OvrStream: this.actionControl = (this.action != null) ? new OvrStreamActionControl((OvrStreamAction)this.action) : new OvrStreamActionControl(); break; case ActionTypeEnum.StreamingPlatform: this.actionControl = (this.action != null) ? new StreamingPlatformActionControl((StreamingPlatformAction)this.action) : new StreamingPlatformActionControl(); break; case ActionTypeEnum.IFTTT: this.actionControl = (this.action != null) ? new IFTTTActionControl((IFTTTAction)this.action) : new IFTTTActionControl(); break; case ActionTypeEnum.Clips: this.actionControl = (this.action != null) ? new ClipsActionControl((ClipsAction)this.action) : new ClipsActionControl(); break; #pragma warning disable CS0612 // Type or member is obsolete case ActionTypeEnum.ActionGroup: if (this.action != null) { ActionGroupAction aaction = (ActionGroupAction)this.action; this.actionControl = new CommandActionControl(new CommandAction() { CommandActionType = CommandActionTypeEnum.RunCommand, CommandID = aaction.ActionGroupID }); } break; case ActionTypeEnum.SongRequest: this.actionControl = null; break; case ActionTypeEnum.Spotify: this.actionControl = null; break; case ActionTypeEnum.Interactive: this.actionControl = null; break; case ActionTypeEnum.MixerClips: this.actionControl = null; break; #pragma warning restore CS0612 // Type or member is obsolete } } this.ActionControlContentControl = (ContentControl)this.GetByUid("ActionControlContentControl"); if (this.ActionControlContentControl != null && this.actionControl != null) { this.ActionControlContentControl.Content = this.actionControl; } }
public ActionGroupActionControl(ActionContainerControl containerControl, ActionGroupAction action) : this(containerControl) { this.action = action; }
private void ActionContainerControl_Loaded(object sender, RoutedEventArgs e) { this.GroupBoxHeaderTextBlock = (TextBlock)this.GetByUid("GroupBoxHeaderTextBlock"); this.GroupBoxHeaderTextBox = (TextBox)this.GetByUid("GroupBoxHeaderTextBox"); this.ActionControlContentControl = (ContentControl)this.GetByUid("ActionControlContentControl"); if (this.actionControl == null) { switch (this.type) { case ActionTypeEnum.Chat: this.actionControl = (this.action != null) ? new ChatActionControl(this, (ChatAction)this.action) : new ChatActionControl(this); break; case ActionTypeEnum.Currency: this.actionControl = (this.action != null) ? new CurrencyActionControl(this, (CurrencyAction)this.action) : new CurrencyActionControl(this); break; case ActionTypeEnum.ExternalProgram: this.actionControl = (this.action != null) ? new ExternalProgramActionControl(this, (ExternalProgramAction)this.action) : new ExternalProgramActionControl(this); break; case ActionTypeEnum.Input: this.actionControl = (this.action != null) ? new InputActionControl(this, (InputAction)this.action) : new InputActionControl(this); break; case ActionTypeEnum.Overlay: this.actionControl = (this.action != null) ? new OverlayActionControl(this, (OverlayAction)this.action) : new OverlayActionControl(this); break; case ActionTypeEnum.Sound: this.actionControl = (this.action != null) ? new SoundActionControl(this, (SoundAction)this.action) : new SoundActionControl(this); break; case ActionTypeEnum.Wait: this.actionControl = (this.action != null) ? new WaitActionControl(this, (WaitAction)this.action) : new WaitActionControl(this); break; case ActionTypeEnum.Counter: this.actionControl = (this.action != null) ? new CounterActionControl(this, (CounterAction)this.action) : new CounterActionControl(this); break; case ActionTypeEnum.GameQueue: this.actionControl = (this.action != null) ? new GameQueueActionControl(this, (GameQueueAction)this.action) : new GameQueueActionControl(this); break; case ActionTypeEnum.Interactive: this.actionControl = (this.action != null) ? new InteractiveActionControl(this, (InteractiveAction)this.action) : new InteractiveActionControl(this); break; case ActionTypeEnum.TextToSpeech: this.actionControl = (this.action != null) ? new TextToSpeechActionControl(this, (TextToSpeechAction)this.action) : new TextToSpeechActionControl(this); break; case ActionTypeEnum.WebRequest: this.actionControl = (this.action != null) ? new WebRequestActionControl(this, (WebRequestAction)this.action) : new WebRequestActionControl(this); break; #pragma warning disable CS0612 // Type or member is obsolete case ActionTypeEnum.ActionGroup: if (this.action != null) { ActionGroupAction aaction = (ActionGroupAction)this.action; this.actionControl = new CommandActionControl(this, new CommandAction() { CommandActionType = CommandActionTypeEnum.RunCommand, CommandID = aaction.ActionGroupID }); } #pragma warning restore CS0612 // Type or member is obsolete break; case ActionTypeEnum.SpecialIdentifier: this.actionControl = (this.action != null) ? new SpecialIdentifierActionControl(this, (SpecialIdentifierAction)this.action) : new SpecialIdentifierActionControl(this); break; case ActionTypeEnum.File: this.actionControl = (this.action != null) ? new FileActionControl(this, (FileAction)this.action) : new FileActionControl(this); break; case ActionTypeEnum.SongRequest: this.actionControl = (this.action != null) ? new SongRequestActionControl(this, (SongRequestAction)this.action) : new SongRequestActionControl(this); break; case ActionTypeEnum.Spotify: this.actionControl = (this.action != null) ? new SpotifyActionControl(this, (SpotifyAction)this.action) : new SpotifyActionControl(this); break; case ActionTypeEnum.Discord: this.actionControl = (this.action != null) ? new DiscordActionControl(this, (DiscordAction)this.action) : new DiscordActionControl(this); break; case ActionTypeEnum.Translation: this.actionControl = (this.action != null) ? new TranslationActionControl(this, (TranslationAction)this.action) : new TranslationActionControl(this); break; case ActionTypeEnum.Twitter: this.actionControl = (this.action != null) ? new TwitterActionControl(this, (TwitterAction)this.action) : new TwitterActionControl(this); break; case ActionTypeEnum.Conditional: this.actionControl = (this.action != null) ? new ConditionalActionControl(this, (ConditionalAction)this.action) : new ConditionalActionControl(this); break; case ActionTypeEnum.StreamingSoftware: this.actionControl = (this.action != null) ? new StreamingSoftwareActionControl(this, (StreamingSoftwareAction)this.action) : new StreamingSoftwareActionControl(this); break; case ActionTypeEnum.Streamlabs: this.actionControl = (this.action != null) ? new StreamlabsActionControl(this, (StreamlabsAction)this.action) : new StreamlabsActionControl(this); break; case ActionTypeEnum.MixerClips: this.actionControl = (this.action != null) ? new MixerClipsActionControl(this, (MixerClipsAction)this.action) : new MixerClipsActionControl(this); break; case ActionTypeEnum.Command: this.actionControl = (this.action != null) ? new CommandActionControl(this, (CommandAction)this.action) : new CommandActionControl(this); break; case ActionTypeEnum.Serial: this.actionControl = (this.action != null) ? new SerialActionControl(this, (SerialAction)this.action) : new SerialActionControl(this); break; case ActionTypeEnum.Moderation: this.actionControl = (this.action != null) ? new ModerationActionControl(this, (ModerationAction)this.action) : new ModerationActionControl(this); break; case ActionTypeEnum.OvrStream: this.actionControl = (this.action != null) ? new OvrStreamActionControl(this, (OvrStreamAction)this.action) : new OvrStreamActionControl(this); break; case ActionTypeEnum.StreamingPlatform: this.actionControl = (this.action != null) ? new StreamingPlatformActionControl(this, (StreamingPlatformAction)this.action) : new StreamingPlatformActionControl(this); break; case ActionTypeEnum.IFTTT: this.actionControl = (this.action != null) ? new IFTTTActionControl(this, (IFTTTAction)this.action) : new IFTTTActionControl(this); break; } } if (this.action != null && !string.IsNullOrEmpty(this.action.Label)) { this.GroupBoxHeaderTextBox.Text = this.GroupBoxHeaderTextBlock.Text = this.action.Label; } if (this.actionControl != null) { this.ActionControlContentControl.Content = this.actionControl; } if (string.IsNullOrEmpty(this.GroupBoxHeaderTextBox.Text)) { this.GroupBoxHeaderTextBox.Text = this.GroupBoxHeaderTextBlock.Text = EnumHelper.GetEnumName(this.type); } if (this.ActionContainer.IsMinimized) { this.AccordianGroupBoxControl_Minimized(this, new RoutedEventArgs()); } }