public SetDeviceVolumeActionViewModel(SetDeviceVolumeAction action) : base(action) { _action = action; Option = new OptionViewModel(action, nameof(action.Option)); Device = new DeviceListViewModel(action, DeviceListViewModel.DeviceListKind.Recording | DeviceListViewModel.DeviceListKind.DefaultPlayback); Volume = new VolumeViewModel(action); Attach(Option); Attach(Device); Attach(Volume); }
private static IAction GetAction(ActionModel action) { IAction actionInstance = null; switch (action.Action) { case ActionType.WriteFile: actionInstance = new WriteFileAction(); break; case ActionType.IF: actionInstance = new IFAction(); break; case ActionType.HttpRequest: actionInstance = new HttpRequestAction(); break; case ActionType.Shutdown: actionInstance = new ShutdownAction(); break; case ActionType.StartProcess: actionInstance = new StartProcessAction(); break; case ActionType.OpenURL: actionInstance = new OpenURLAction(); break; case ActionType.Snipping: actionInstance = new SnippingAction(); break; case ActionType.DeleteFile: actionInstance = new DeleteFileAction(); break; case ActionType.SoundPlay: actionInstance = new SoundPlayAction(); break; case ActionType.GetIPAddress: actionInstance = new GetIPAddressAction(); break; case ActionType.Keyboard: actionInstance = new KeyboardAction(); break; case ActionType.SystemNotification: actionInstance = new SystemNotificationAction(); break; case ActionType.DownloadFile: actionInstance = new DownloadFileAction(); break; case ActionType.Dialog: actionInstance = new DialogAction(); break; case ActionType.Delay: actionInstance = new DelayAction(); break; case ActionType.Loops: actionInstance = new LoopsAction(); break; case ActionType.KillProcess: actionInstance = new KillProcessAction(); break; case ActionType.SetDeviceVolume: actionInstance = new SetDeviceVolumeAction(); break; case ActionType.Regex: actionInstance = new RegexAction(); break; case ActionType.ReadFile: actionInstance = new ReadFileAction(); break; case ActionType.JsonDeserialize: actionInstance = new JsonDeserializeAction(); break; } if (actionInstance != null) { return(actionInstance); } return(null); }