コード例 #1
0
        public static StreamResponse Create(int exitCode, string stdout, string stderr)
        {
            var response = new StreamResponse
                {
                    Name       = Constants.STDOUT_NAME,
                    Data       = String.Empty,
                };

            if (!stdout.IsNullOrEmpty())
            {
                response.Name = Constants.STDOUT_NAME;
                response.Data = stdout;
            }
            else if (!stderr.IsNullOrEmpty())
            {
                response.Name = Constants.STDERR_NAME;
                response.Data = stderr;
            }

            unchecked
            {
                response.ExitStatus = (uint)exitCode;
            }

            return response;
        }
コード例 #2
0
        public static StreamResponse Create(int exitCode, string stdout, string stderr)
        {
            var response = new StreamResponse
            {
                Name = Constants.STDOUT_NAME,
                Data = String.Empty,
            };

            if (!String.IsNullOrEmpty(stdout))
            {
                response.Name = Constants.STDOUT_NAME;
                response.Data = stdout;
            }
            else if (!String.IsNullOrEmpty(stderr))
            {
                response.Name = Constants.STDERR_NAME;
                response.Data = stderr;
            }

            unchecked
            {
                response.ExitStatus = (uint)exitCode;
            }

            return(response);
        }
コード例 #3
0
 public static StreamResponse Create(int? exitStatus, string dataSource, string data)
 {
     var streamResponse = new StreamResponse { Name = dataSource, Data = data };
     if (exitStatus.HasValue)
     {
         unchecked
         {
             streamResponse.ExitStatus = (uint)exitStatus.Value;
         }
     }
     return streamResponse;
 }
コード例 #4
0
        public static StreamResponse Create(int?exitStatus, string dataSource, string data)
        {
            var streamResponse = new StreamResponse {
                Name = dataSource, Data = data
            };

            if (exitStatus.HasValue)
            {
                unchecked
                {
                    streamResponse.ExitStatus = (uint)exitStatus.Value;
                }
            }
            return(streamResponse);
        }