protected override Task <ActionModelBase> GetActionInternal() { if (this.SelectedActionType == VoicemodActionTypeEnum.VoiceChangerOnOff) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForVoiceChangerOnOff(this.State))); } else if (this.SelectedActionType == VoicemodActionTypeEnum.SelectVoice) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForSelectVoice(this.SelectedVoice != null ? this.SelectedVoice.voiceID : this.voiceID))); } else if (this.SelectedActionType == VoicemodActionTypeEnum.RandomVoice) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForRandomVoice(this.SelectedRandomVoiceType))); } else if (this.SelectedActionType == VoicemodActionTypeEnum.BeepSoundOnOff) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForBeepSoundOnOff(this.State))); } else if (this.SelectedActionType == VoicemodActionTypeEnum.PlaySound) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForPlaySound(this.SelectedSound != null ? this.SelectedSound.FileName : this.soundFileName))); } else if (this.SelectedActionType == VoicemodActionTypeEnum.StopAllSounds) { return(Task.FromResult <ActionModelBase>(VoicemodActionModel.CreateForStopAllSounds())); } return(Task.FromResult <ActionModelBase>(null)); }
public VoicemodActionEditorControlViewModel(VoicemodActionModel action) : base(action) { this.SelectedActionType = action.ActionType; if (this.ShowStateGrid) { this.State = action.State; } else if (this.ShowVoiceGrid) { this.voiceID = action.VoiceID; } else if (this.ShowRandomVoiceGrid) { this.SelectedRandomVoiceType = action.RandomVoiceType; } else if (this.ShowPlaySoundGrid) { this.soundFileName = action.SoundFileName; } }