本文整理汇总了C#中ByteArrayPart.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayPart.ToString方法的具体用法?C# ByteArrayPart.ToString怎么用?C# ByteArrayPart.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteArrayPart
的用法示例。
在下文中一共展示了ByteArrayPart.ToString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: It_should_trim_sws_at_end
public void It_should_trim_sws_at_end()
{
var part1 = new ByteArrayPart("X\r\n ");
part1.TrimEndSws();
var part2 = new ByteArrayPart("X \r\n ");
part2.TrimEndSws();
var part3 = new ByteArrayPart("X \r\n ");
part3.TrimEndSws();
var part4 = new ByteArrayPart(" \r\n ");
part4.TrimEndSws();
var part5 = new ByteArrayPart(" \r\n ");
part5.TrimEndSws();
var part6 = new ByteArrayPart("X ");
part6.TrimEndSws();
var part7 = new ByteArrayPart("");
part7.TrimEndSws();
Assert.AreEqual("X", part1.ToString());
Assert.AreEqual("X", part2.ToString());
Assert.AreEqual("X", part3.ToString());
Assert.AreEqual("", part4.ToString());
Assert.AreEqual("", part5.ToString());
Assert.AreEqual("X", part6.ToString());
Assert.AreEqual("", part7.ToString());
}
示例2: ProcessPutItem
public override HttpMessageWriter ProcessPutItem(ByteArrayPart username, ByteArrayPart domain, HttpMessageReader reader, ArraySegment<byte> content)
{
var statusCode = StatusCodes.OK;
int sipIfMatch = simpleModule.InvalidEtag;
if (reader.Count.IfMatches > 0)
{
if (HexEncoding.TryParseHex8(reader.IfMatches[0].Bytes, reader.IfMatches[0].Begin, out sipIfMatch) == false)
statusCode = StatusCodes.PreconditionFailed;
}
if (statusCode == StatusCodes.OK)
{
if (simpleModule.Publish(username.ToString() + "@" + domain.ToString(), ref sipIfMatch, 60, content) == false)
statusCode = StatusCodes.BadRequest;
}
HttpMessageWriter response;
if (statusCode != StatusCodes.OK)
{
response = CreateResponse(statusCode);
}
else
{
response = CreateNotFinishedResponse(statusCode, ContentType.None);
response.WriteEtag(sipIfMatch);
response.WriteCRLF();
}
return response;
}
示例3: ProcessGetItem
public override HttpMessageWriter ProcessGetItem(ByteArrayPart username, ByteArrayPart domain)
{
var document = simpleModule.GetDocument(username.ToString() + "@" + domain.ToString());
if (document == null)
{
return base.CreateResponse(StatusCodes.NotFound);
}
else
{
var response = base.CreateNotFinishedResponse(StatusCodes.OK, ContentType.ApplicationPidfXml);
document.WriteLenghtAndContent(response);
return response;
}
}
示例4: LocationService_ContactRemoved
private void LocationService_ContactRemoved(ByteArrayPart aor1, LocationService.Binding binding)
{
enhancedPresence.EndpointUnregistered(aor1.ToString(),
binding.SipInstance.IsValid ? binding.SipInstance.ToString() : binding.AddrSpec.ToString());
}
示例5: LocationService_ContactAdded
/// <summary>
/// Обработчик события evRegisteredAORContact от Location Service.
/// </summary>
private void LocationService_ContactAdded(ByteArrayPart aor1, LocationService.Binding contact, SipMessageReader request)
{
var aor = aor1.ToString();
bool ep = false;
for (var i = 0; i < request.Count.SupportedCount; i++)
{
if (request.Supported[i].Option.ToString() == @"msrtc-event-categories")
{
ep = true;
break;
}
}
enhancedPresence.EndpointRegistered(aor, contact.SipInstance.Length != 0 ? contact.SipInstance.ToString() : contact.AddrSpec.ToString(), ep);
}
示例6: LocationService_AorRemoved
private void LocationService_AorRemoved(ByteArrayPart aor)
{
enhancedPresence.UserUnregistered(aor.ToString());
}
示例7: HasDomain
public bool HasDomain(ByteArrayPart domain)
{
return domain.IsValid && accounts2.ContainsKey(domain.ToString());
}
示例8: GetAccount
public IAccount GetAccount(ByteArrayPart domain)
{
return domain.IsInvalid ? null : accounts2.GetValue(domain.ToString());
}
示例9: GetPassword
private string GetPassword(int accountId, ByteArrayPart username)
{
var username2 = username.ToString();
for (int i = 0; i < userz.Count; i++)
{
if (userz[i].HasPasswords)
{
var user = userz[i].GetByName(accountId, username2);
if (user != null)
return user.Password;
}
}
return null;
}
示例10: GetEnumerableBindings
public IEnumerable<LocationService.Binding> GetEnumerableBindings(ByteArrayPart aor)
{
return GetEnumerableBindingsEv(aor.ToString());
}
示例11: HasDomain
public bool HasDomain(ByteArrayPart domain)
{
return domain.ToString() == "officesip.local";
}