本文整理汇总了C#中ResponseStatus类的典型用法代码示例。如果您正苦于以下问题:C# ResponseStatus类的具体用法?C# ResponseStatus怎么用?C# ResponseStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResponseStatus类属于命名空间,在下文中一共展示了ResponseStatus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ResponseBuilder
public ResponseBuilder([NotNull] JsonResponses jsonResponses, ResponseStatus status)
{
this.jsonResponses = jsonResponses;
this.status = status;
message = string.Empty;
links = new List<Link>();
}
开发者ID:ThePadawan,项目名称:the_diary,代码行数:7,代码来源:ResponseBuilder.cs
示例2: JsonResponse
public JsonResponse(string sessionId, ResponseStatus responseCode, object value)
{
this.SessionId = sessionId;
this.Status = responseCode;
this.Value = responseCode == ResponseStatus.Success ? value : this.PrepareErrorResponse(value);
}
开发者ID:amolpathak224,项目名称:Winium.Desktop,代码行数:7,代码来源:JsonWireClasses.cs
示例3: Receive
public void Receive()
{
Reader = new BinaryReader(Connection.GetNetworkStream());
var reader = Reader;
Status = (ResponseStatus)reader.ReadByte();
SessionId = reader.ReadInt32EndianAware();
if (Status == ResponseStatus.ERROR)
{
string exceptionString = "";
byte followByte = reader.ReadByte();
while (followByte == 1)
{
int exceptionClassLength = reader.ReadInt32EndianAware();
exceptionString += System.Text.Encoding.Default.GetString(reader.ReadBytes(exceptionClassLength)) + ": ";
int exceptionMessageLength = reader.ReadInt32EndianAware();
// don't read exception message string if it's null
if (exceptionMessageLength != -1)
{
exceptionString += System.Text.Encoding.Default.GetString(reader.ReadBytes(exceptionMessageLength)) + "\n";
}
followByte = reader.ReadByte();
}
if (OClient.ProtocolVersion >= 19) {
int serializedVersionLength = reader.ReadInt32EndianAware();
var buffer = reader.ReadBytes(serializedVersionLength);
}
throw new OException(OExceptionType.Operation, exceptionString);
}
}
开发者ID:PaybackMan,项目名称:Cinder,代码行数:35,代码来源:Response.cs
示例4: StatusElse
public void StatusElse(ResponseStatus status)
{
var response = new SagePay.Response.RefundResponse();
response.Status = status;
Assert.False(response.IsValid());
}
开发者ID:OrangeT,项目名称:SagePay,代码行数:7,代码来源:RefundResponse.cs
示例5: DecodeResponse
public void DecodeResponse(StreamReader xmlResponse)
{
_ResponseStatus = new ResponseStatus();
_ResponseData = new DataFields();
string xmlData = xmlResponse.ReadToEnd();
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(xmlData);
XmlNodeList nodeList = xmlDocument.SelectNodes("/response");
foreach (XmlNode xmlNode in nodeList[0].ChildNodes)
{
switch (xmlNode.Name)
{
case "status":
_ResponseStatus.Code = xmlNode.InnerText;
_ResponseStatus.Text = getResponseText(xmlNode.InnerText);
break;
case "token":
_ResponseStatus.Token = xmlNode.InnerText;
break;
case "error":
_ResponseStatus.Error = xmlNode.InnerText;
break;
case "data":
_ResponseData = NodeToDataFields(xmlNode.ChildNodes);
break;
default:
break;
}
}
}
开发者ID:HughJeffner,项目名称:cs-sdk,代码行数:34,代码来源:APIResponse.cs
示例6: ServiceResponse
/// <summary>
/// Constructor with parameters.
/// </summary>
/// <param name="version">The API version of the response.</param>
/// <param name="status">The response status.</param>
public ServiceResponse(string version, ResponseStatus status)
: base()
{
this.Version = version;
this.Status = status.ToString();
this.EndPoint = this.ResolveEndpoint();
}
开发者ID:petervyvey,项目名称:membrane,代码行数:13,代码来源:ServiceResponse.cs
示例7: AddErrorMessage
public void AddErrorMessage(string errorMessage, bool setStatusToFailed = true)
{
_errorMessages.Add(errorMessage);
if (setStatusToFailed)
{
_responseStatus = ResponseStatus.Failure;
}
}
开发者ID:ojji,项目名称:peoneer,代码行数:8,代码来源:ResponseBase.cs
示例8: ResponseJson
public ResponseJson(ResponseStatus status)
{
this.status = status;
data = "{}";
message = "";
time = DateTime.Now;
remark = "";
}
开发者ID:ckyzx,项目名称:OnlineLearningSystem,代码行数:8,代码来源:ResponseJson.cs
示例9: Parse
public virtual void Parse(
ResponseStatus responseStatus,
ArraySegment<byte> bodyData,
ArraySegment<byte> extras,
ArraySegment<byte> key,
int bytesOfBodyPreviouslyRead,
int totalBodyLength)
{
}
开发者ID:akutruff,项目名称:Couchbase.Net,代码行数:9,代码来源:MemcachedCommand.cs
示例10: Log
public void Log(ResponseStatus responseStatus, string resourceUrl)
{
Console.WriteLine("Console and file loger URL: {1} | Status: {0}", responseStatus, resourceUrl);
using (var stWr = new StreamWriter(@"../log.txt",true))
{
var sb = new StringBuilder(String.Format("{0} | {1} | {2}", DateTime.Now.ToString(), resourceUrl, responseStatus));
stWr.WriteLine(sb);
}
}
开发者ID:kuwkuw,项目名称:DI_IoC,代码行数:9,代码来源:ExtendedLoger.cs
示例11: GetDetailUrl
/// <summary>
/// Gets the URL for the Response detail page of a given Response instance.
/// </summary>
/// <param name="eventId">The event ID.</param>
/// <param name="eventStart">The date for which this response was made.</param>
/// <param name="status">The status.</param>
/// <param name="count">The number of Responses for this event and status.</param>
/// <returns>
/// A URL for the Response detail page of a given Response instance
/// </returns>
private string GetDetailUrl(int eventId, DateTime eventStart, ResponseStatus status, int count)
{
return count > 0
? this.BuildLinkUrl(
this.ModuleId,
"ResponseDetail",
Utility.GetEventParameters(eventId, eventStart, "status=" + status))
: string.Empty;
}
开发者ID:JoshuaBradley,项目名称:Engage-Events,代码行数:19,代码来源:ResponseDisplay.ascx.cs
示例12: JsonResponse
protected string JsonResponse(ResponseStatus status, object value)
{
if (status != ResponseStatus.Success && value == null)
{
value = string.Format("WebDriverException {0}", Enum.GetName(typeof(ResponseStatus), status));
}
return JsonConvert.SerializeObject(new JsonResponse(this.Session, status, value));
}
开发者ID:goldbillka,项目名称:Winium.StoreApps,代码行数:9,代码来源:CommandBase.cs
示例13: PingResult
public PingResult(int pingResultId, int statusCode, string statusDescription, string server, Uri responseUri, ResponseStatus responseStatus, DateTime dateCreated)
{
this.PingResultId = pingResultId;
this.StatusCode = statusCode;
this.StatusDescription = statusDescription;
this.Server = server;
this.ResponseUri = responseUri.ToString();
this.ResponseStatus = responseStatus.ToString();
this.DateCreated = dateCreated;
}
开发者ID:tslang,项目名称:A7Dashboard,代码行数:10,代码来源:PingResult.cs
示例14: SetupIRestClientMock
public static Mock<IRestClient> SetupIRestClientMock(ResponseStatus responsesStatus, string filename)
{
var moqRestClient = new Mock<IRestClient>();
moqRestClient.Setup(x => x.Execute(It.Is<IRestRequest>
(p => p.Parameters.Exists(y => y.Name == "user")
&& p.Parameters.Exists(y => y.Name == "file")
&& p.Parameters.Exists(y => y.Value == "matt")
&& p.Parameters.Exists(y => y.Value == filename))
))
.Returns(new RestResponse() { ResponseStatus = responsesStatus });
return moqRestClient;
}
开发者ID:matthewrouse1,项目名称:FLIG,代码行数:12,代码来源:LockedFilesModelTests.cs
示例15: Can_serialize_ResponseStats
public void Can_serialize_ResponseStats()
{
var dto = new ResponseStatus {
ErrorCode = null
};
var dtoString = TypeSerializer.SerializeToString(dto);
Assert.That(dtoString, Is.EqualTo("{Errors:[]}"));
Console.WriteLine(dtoString);
}
开发者ID:nuxleus,项目名称:ServiceStack.Text,代码行数:12,代码来源:DdnDtoTests.cs
示例16: Only_Serializes_DataMember_fields_for_DataContracts
public void Only_Serializes_DataMember_fields_for_DataContracts()
{
var dto = new ResponseStatus
{
ErrorCode = "ErrorCode",
Message = "Message",
StackTrace = "StackTrace",
Errors = new List<ResponseError>(),
};
Serialize(dto);
}
开发者ID:nuxleus,项目名称:ServiceStack.Text,代码行数:12,代码来源:DataContractTests.cs
示例17: Log
public void Log(ResponseStatus responseStatus, string resourceUrl)
{
Console.WriteLine("File loger");
using (Stream st = File.Open("../log.txt",FileMode.OpenOrCreate, FileAccess.Write))
{
var stWr =new StreamWriter(st);
var sb = new StringBuilder(String.Format("{0} | {1}\n", resourceUrl, responseStatus));
stWr.WriteLine(sb);
stWr.Flush();
}
}
开发者ID:kuwkuw,项目名称:DI_IoC,代码行数:12,代码来源:ToFileLoger.cs
示例18: HandleError
/// <summary>
/// HandleError
/// </summary>
/// <param name="responseStatus"></param>
protected void HandleError(ResponseStatus responseStatus, ServiceResponseMessage responseMessage)
{
if (responseStatus == ResponseStatus.BusinessException)
{
throw new BusinessException(responseMessage.Message, responseMessage.MessageCode, responseMessage.Overridable);
}
else if (responseStatus == ResponseStatus.Exception)
{
throw new SysException(responseMessage.Message);
}
}
开发者ID:eCollobro,项目名称:eCollabro,代码行数:16,代码来源:BaseClient.cs
示例19: Load_WhenNotSuccess_ReturnNull
public void Load_WhenNotSuccess_ReturnNull(ResponseStatus status)
{
//arrange
var result = new Mock<IOperationResult<byte[]>>();
result.Setup(x => x.Status).Returns(status);
var bucket = new Mock<IBucket>();
bucket.Setup(x => x.Get<byte[]>(It.IsAny<string>())).Returns(result.Object);
//act
var item = SessionStateItem.Load(bucket.Object, "thekey", false);
//assert
Assert.IsNull(item);
}
开发者ID:couchbaselabs,项目名称:couchbase-aspnet,代码行数:15,代码来源:SessionStateItemTests.cs
示例20: Parse
public override void Parse(
ResponseStatus responseStatus,
ArraySegment<byte> bodyData,
ArraySegment<byte> extras,
ArraySegment<byte> key,
int bytesOfBodyPreviouslyRead,
int totalBodyLength)
{
if (bytesOfBodyPreviouslyRead == 0)
{
_decoder = new StringDecoder();
}
_decoder.Decode(bodyData);
}
开发者ID:akutruff,项目名称:Couchbase.Net,代码行数:15,代码来源:GetCommand.cs
注:本文中的ResponseStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论