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


C# MessagePackObject.GetString方法代码示例

本文整理汇总了C#中MessagePackObject.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# MessagePackObject.GetString方法的具体用法?C# MessagePackObject.GetString怎么用?C# MessagePackObject.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessagePackObject的用法示例。


在下文中一共展示了MessagePackObject.GetString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RpcException

		/// <summary>
		///		Initialize new instance with unpacked data.
		/// </summary>
		/// <param name="rpcError">
		///		Metadata of error. If you specify null, <see cref="MsgPack.Rpc.RpcError.RemoteRuntimeError"/> is used.
		///	</param>
		/// <param name="unpackedException">
		///		Exception data from remote MessagePack-RPC server.
		///	</param>
		/// <exception cref="SerializationException">
		///		Cannot deserialize instance from <paramref name="unpackedException"/>.
		/// </exception>
		protected internal RpcException( RpcError rpcError, MessagePackObject unpackedException )
			: this( rpcError, unpackedException.GetString( MessageKeyUtf8 ), unpackedException.GetString( DebugInformationKeyUtf8 ) )
		{
			if ( unpackedException.IsDictionary )
			{
				MessagePackObject mayBeArray;
				if ( unpackedException.AsDictionary().TryGetValue( _remoteExceptionsUtf8, out mayBeArray ) && mayBeArray.IsArray )
				{
					var array = mayBeArray.AsList();
					this._remoteExceptions = new RemoteExceptionInformation[ array.Count ];
					for ( int i = 0; i < this._remoteExceptions.Length; i++ )
					{
						if ( array[ i ].IsList )
						{
							this._remoteExceptions[ i ] = new RemoteExceptionInformation( array[ i ].AsList() );
						}
						else
						{
							// Unexpected type.
							Debug.WriteLine( "Unexepcted ExceptionInformation at {0}, type: {1}, value: \"{2}\".", i, array[ i ].UnderlyingType, array[ i ] );
							this._remoteExceptions[ i ] = new RemoteExceptionInformation( new MessagePackObject[] { array[ i ] } );
						}
					}
				}
			}

#if !SILVERLIGHT && !MONO
			this.RegisterSerializeObjectStateEventHandler();
#endif
		}
开发者ID:Indifer,项目名称:Test,代码行数:42,代码来源:RpcException.Propagation.cs

示例2: RpcMethodInvocationException

		/// <summary>
		///		Initialize new instance with unpacked data.
		/// </summary>
		/// <param name="rpcError">
		///		Metadata of error. If you specify null, <see cref="MsgPack.Rpc.RpcError.RemoteRuntimeError"/> is used.
		///	</param>
		/// <param name="unpackedException">
		///		Exception data from remote MessagePack-RPC server.
		///	</param>
		/// <exception cref="SerializationException">
		///		Cannot deserialize instance from <paramref name="unpackedException"/>.
		/// </exception>
		protected internal RpcMethodInvocationException( RpcError rpcError, MessagePackObject unpackedException )
			: base( rpcError, unpackedException )
		{
			this._methodName = unpackedException.GetString( MethodNameKeyUtf8 );
			Contract.Assume( this._methodName != null, "Unpacked data does not have MethodName." );
		}
开发者ID:Indifer,项目名称:Test,代码行数:18,代码来源:RpcMethodInvocationException.cs

示例3: RpcArgumentException

		/// <summary>
		///		Initializes a new instance with serialized data. 
		/// </summary>
		/// <param name="unpackedException">
		///		Exception data from remote MessagePack-RPC server.
		///	</param>
		/// <exception cref="SerializationException">
		///		Cannot deserialize instance from <paramref name="unpackedException"/>.
		/// </exception>
		internal RpcArgumentException( MessagePackObject unpackedException )
			: base( RpcError.ArgumentError, unpackedException )
		{
			this._parameterName = unpackedException.GetString( ParameterNameKeyUtf8 );
			Contract.Assume( this._parameterName != null, "Unpacked data does not have ParameterName." );
		}
开发者ID:Indifer,项目名称:Test,代码行数:15,代码来源:RpcArgumentException.cs


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