예제 #1
0
        internal void ExecuteCmdlet(IEnumerable pipelineInput, RunResult runResult, out PowerShellResults <PSObject> result, bool isGetListAsync = false)
        {
            DDIHelper.Trace(TraceType.InfoTrace, "Executing :" + base.GetType().Name);
            DDIHelper.Trace(TraceType.InfoTrace, "Task: {0}", new object[]
            {
                this.Command
            });
            DDIHelper.Trace(TraceType.InfoTrace, "Pipeline: {0}", new object[]
            {
                pipelineInput
            });
            WebServiceParameters parameters = null;

            if (this.AllowExceuteThruHttpGetRequest)
            {
                parameters = CmdletActivity.allowExceuteThruHttpGetRequestParameters;
            }
            result = this.Command.Invoke <PSObject>(DataSourceService.UserRunspaces, pipelineInput, parameters, this, isGetListAsync);
            if (this.DisableLogging)
            {
                result.CmdletLogInfo = null;
            }
            this.StatusReport    = result;
            runResult.ErrorOccur = !this.StatusReport.Succeeded;
        }
예제 #2
0
        private void addToDicitonary(WebServiceParameters call)
        {
            var context = new InjectionContext();

            context.addMapping <IResponseReader>(new ResponseReader());
            context.addNamedMapping <string>(NamedInjections.API_TOKEN, "faketoken");
            context.setMappings(call);
            allParsers.Add(call.GetType(), call);
        }
        public string justCall(WebServiceParameters call)
        {
            if(call.getParameters.ContainsKey("token"))
                call.getParameters.Remove("token");

            call.getParameters.Add("token", accessToken);
            var requester = new SyncronousEditorWebRequest();
            WebServiceReturnStatus result = requester.request(call);
            if(result.httpErrorCode > 0)
            {
                throw new HttpErrorCode(result.httpErrorCode);
            }
            return result.text;
        }
 private void doCall(WebServiceParameters call, Action callback)
 {
     call.getParameters.Add("token", _token);
     new EditorWWWWaitUntil(call, (WebServiceReturnStatus status) =>
         {
             if(status.httpErrorCode > 0 && status.httpErrorCode != 200)
             {
                 EditorUtility.DisplayDialog("ERROR", "Error while ordering translation. Please try again.", "OK");
             }
             if(callback != null)
             {
                 callback();
             }
         }
     );
 }
예제 #5
0
        public string justCall(WebServiceParameters call)
        {
            if (call.getParameters.ContainsKey("token"))
            {
                call.getParameters.Remove("token");
            }

            call.getParameters.Add("token", accessToken);
            var requester = new SyncronousEditorWebRequest();
            WebServiceReturnStatus result = requester.request(call);

            if (result.httpErrorCode > 0)
            {
                throw new HttpErrorCode(result.httpErrorCode);
            }
            return(result.text);
        }
예제 #6
0
 public PowerShellResults <O> Invoke <O>(RunspaceMediator runspaceMediator, IEnumerable pipelineInput, WebServiceParameters parameters, CmdletActivity activity, bool isGetListAsync)
 {
     return(this.command.Invoke(runspaceMediator, pipelineInput, parameters, activity, isGetListAsync));
 }
        private WebServiceReturnStatus doCall(WebServiceParameters call)
        {
            IWebService req = new SyncronousEditorWebRequest();
            try
            {
                call.getParameters.Add("token", _token);

                WebServiceReturnStatus result = req.request(call);
                return result;
            }
            catch(HttpErrorCode code)
            {
                Debug.Log(code.code + " http error");
                throw;
            }
        }