public virtual HashSet <ActionTypeEnum> GetActionTypesInCommand(HashSet <Guid> commandIDs = null) { HashSet <ActionTypeEnum> actionTypes = new HashSet <ActionTypeEnum>(); if (commandIDs == null) { commandIDs = new HashSet <Guid>(); } if (commandIDs.Contains(this.ID)) { return(actionTypes); } commandIDs.Add(this.ID); foreach (ActionModelBase action in this.Actions) { if (action.Type == ActionTypeEnum.Command) { CommandActionModel commandAction = (CommandActionModel)action; CommandModelBase subCommand = ChannelSession.Settings.GetCommand(commandAction.CommandID); if (subCommand != null) { foreach (ActionTypeEnum subActionType in subCommand.GetActionTypesInCommand(commandIDs)) { actionTypes.Add(subActionType); } } } else if (action.Type == ActionTypeEnum.Overlay) { OverlayActionModel overlayAction = (OverlayActionModel)action; if (overlayAction.OverlayItem.ItemType == Overlay.OverlayItemModelTypeEnum.Video || overlayAction.OverlayItem.ItemType == Overlay.OverlayItemModelTypeEnum.YouTube) { actionTypes.Add(ActionTypeEnum.Sound); } } else if (action.Type == ActionTypeEnum.TextToSpeech) { actionTypes.Add(ActionTypeEnum.Sound); } else if (action.Type == ActionTypeEnum.OvrStream) { actionTypes.Add(ActionTypeEnum.Sound); actionTypes.Add(ActionTypeEnum.Overlay); } else if (action.Type == ActionTypeEnum.StreamingSoftware) { actionTypes.Add(ActionTypeEnum.Sound); actionTypes.Add(ActionTypeEnum.Overlay); } actionTypes.Add(action.Type); } actionTypes.Remove(ActionTypeEnum.Command); actionTypes.Remove(ActionTypeEnum.Wait); return(actionTypes); }
public CommandActionEditorControlViewModel(CommandActionModel action) : base(action) { this.SelectedActionType = action.ActionType; if (this.ShowCommandsSection) { if (action.Command != null) { this.SelectedCommandType = action.Command.Type; this.SelectedCommand = action.Command; } this.CommandArguments = action.Arguments; this.WaitForCommandToFinish = action.WaitForCommandToFinish; } else if (this.ShowCommandGroupsSection) { this.SelectedCommandGroup = action.CommandGroupName; } }