예제 #1
0
        private static System.Action GetAction(int taskID, 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;
            }
            if (actionInstance != null)
            {
                return(actionInstance.GenerateAction(taskID, action));
            }
            return(null);
        }
예제 #2
0
        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);
        }