当前位置: 首页>>代码示例>>C#>>正文


C# ByteArrayPart.ToString方法代码示例

本文整理汇总了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());
		}
开发者ID:five-x,项目名称:siprevo,代码行数:31,代码来源:ByteArrayPartTest.cs

示例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;
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:32,代码来源:PidfManipulationHandler.cs

示例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;
			}
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:17,代码来源:PidfManipulationHandler.cs

示例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());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:5,代码来源:MsPresTU.cs

示例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);
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:19,代码来源:MsPresTU.cs

示例6: LocationService_AorRemoved

		private void LocationService_AorRemoved(ByteArrayPart aor)
		{
			enhancedPresence.UserUnregistered(aor.ToString());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:4,代码来源:MsPresTU.cs

示例7: HasDomain

		public bool HasDomain(ByteArrayPart domain)
		{
			return domain.IsValid && accounts2.ContainsKey(domain.ToString());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:4,代码来源:Accountx.cs

示例8: GetAccount

		public IAccount GetAccount(ByteArrayPart domain)
		{
			return domain.IsInvalid ? null : accounts2.GetValue(domain.ToString());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:4,代码来源:Accountx.cs

示例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;
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:17,代码来源:DigestAuthentication.cs

示例10: GetEnumerableBindings

		public IEnumerable<LocationService.Binding> GetEnumerableBindings(ByteArrayPart aor)
		{
			return GetEnumerableBindingsEv(aor.ToString());
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:4,代码来源:ProxyServerTUTest.cs

示例11: HasDomain

			public bool HasDomain(ByteArrayPart domain)
			{
				return domain.ToString() == "officesip.local";
			}
开发者ID:hungdluit,项目名称:sipserver,代码行数:4,代码来源:ProxyServerTUTest.cs


注:本文中的ByteArrayPart.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。