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


C# IMessage类代码示例

本文整理汇总了C#中IMessage的典型用法代码示例。如果您正苦于以下问题:C# IMessage类的具体用法?C# IMessage怎么用?C# IMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Process

 protected override void Process(IMessage input, Action<IMessage> continueWith, Action<FlowRuntimeException> unhandledException)
 {
     if (input is ActivationMessage)
         _continueWith = continueWith;
     else
         _translator.Process_local_output(input);
 }
开发者ID:ralfw,项目名称:dnp2012,代码行数:7,代码来源:StandInOperation.cs

示例2: TS

 ///<summary>
 /// Creates a TS.
 /// <param name="message">The Message to which this Type belongs</param>
 /// <param name="description">The description of this type</param>
 ///</summary>
 public TS(IMessage message, string description)
     : base(message, description)
 {
     data = new IType[2];
     data[0] = new TSComponentOne(message,"Time of an event");
     data[1] = new ST(message,"Degree of precision");
 }
开发者ID:snosrap,项目名称:nhapi,代码行数:12,代码来源:TS.cs

示例3: ToAmqpMessage

        // NMS Message                       AMQP Message
        // ================================  =================
        // string          NMSCorrelationID  string     CorrelationId
        // MsgDeliveryMode NMSDeliveryMode   bool       Durable
        // IDestination    NMSDestination
        // string          MNSMessageId      string     MessageId
        // MsgPriority     NMSPriority       byte       Priority
        // bool            NMSRedelivered    bool       Redelivered
        // IDestination    NMSReplyTo        Address    ReplyTo
        // DateTime        NMSTimestamp
        // TimeSpan        NMSTimeToLive     Duration   Ttl
        // string          NMSType           string     ContentType
        // IPrimitiveMap   Properties        Dictionary Properties
        //                                   string     Subject
        //                                   string     UserId
        //
        public virtual Message ToAmqpMessage(IMessage message)
        {
            Message amqpMessage = CreateAmqpMessage(message);

            if (null != message.NMSCorrelationID)
            {
                amqpMessage.CorrelationId = message.NMSCorrelationID;
            }
            amqpMessage.Durable = (message.NMSDeliveryMode == MsgDeliveryMode.Persistent);
            if (null != message.NMSMessageId)
            {
                amqpMessage.MessageId = message.NMSMessageId;
            }
            amqpMessage.Priority = ToAmqpMessagePriority(message.NMSPriority);
            amqpMessage.Redelivered = message.NMSRedelivered;
            if (null != message.NMSReplyTo)
            {
                amqpMessage.ReplyTo = ToAmqpAddress(message.NMSReplyTo);
            }

            if (message.NMSTimeToLive != TimeSpan.Zero)
            {
                amqpMessage.Ttl = ToQpidDuration(message.NMSTimeToLive);
            }

            if (null != message.NMSType)
            {
                amqpMessage.ContentType = message.NMSType;
            }

            amqpMessage.Properties = FromNmsPrimitiveMap(message.Properties);

            // TODO: NMSDestination, Amqp.Subect, Amqp.UserId
            return amqpMessage;
        }
开发者ID:ChugR,项目名称:Apache.NMS.AMQP,代码行数:51,代码来源:DefaultMessageConverter.cs

示例4: Invoke

        public override IMessage Invoke(IMessage msg)
        {
            var mcm = msg as IMethodCallMessage;
            if (mcm == null)
                return null;

            if (IsEqualsCall(mcm))
                return ReturnValue(HandleEquals(mcm), mcm);

            if (IsGetHashCodeCall(mcm))
                return ReturnValue(GetHashCode(), mcm);

            if (IsGetTypeCall(mcm))
                return ReturnValue(GetProxiedType(), mcm);

            if (IsToStringCall(mcm))
            {
                var type = GetProxiedType();
                var hashCode = GetHashCode();
                var value = string.Format("RemotingMock_{0}<{1}>", hashCode, type.Name);

                return ReturnValue(value, mcm);
            }

            var invocation = new RemotingInvocation(this, mcm);
            interceptor.Intercept(invocation);

            return ReturnValue(invocation.ReturnValue, invocation.Arguments, mcm);
        }
开发者ID:bytedreamer,项目名称:rhino-mocks,代码行数:29,代码来源:RemotingProxy.cs

示例5: HandleRequestMessage

 protected override void HandleRequestMessage(IMessage message, ReplyMessageHolder replyHolder)
 {
     object result = SplitMessage(message);
     if(result == null) {
         return;
     }
     object correlationId = message.Headers.Id;
     if(result is ICollection) {
         ICollection items = (ICollection)result;
         int sequenceNumber = 0;
         int sequenceCount = items.Count;
         foreach(object item in items) {
             AddReply(replyHolder, item, correlationId, ++sequenceNumber, sequenceCount);
         }
     }
     else if(result.GetType().IsArray) {
         object[] items = (object[])result;
         int sequenceNumber = 0;
         int sequenceSize = items.Length;
         foreach(object item in items) {
             AddReply(replyHolder, item, correlationId, ++sequenceNumber, sequenceSize);
         }
     }
     else {
         AddReply(replyHolder, result, correlationId, 1, 1);
     }
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-integration,代码行数:27,代码来源:AbstractMessageSplitter.cs

示例6: PTA

	///<summary>
	/// Creates a PTA.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PTA(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new IS(message, 147,"Policy Type");
		data[1] = new IS(message, 193,"Amount Class");
		data[2] = new NM(message,"Money or Percentage Quantity");
		data[3] = new MOP(message,"Money or Percentage");
	}
开发者ID:RickIsWright,项目名称:nHapi,代码行数:12,代码来源:PTA.cs

示例7: GetResponseStream

		public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack,
						 object state,
						 IMessage msg,
						 ITransportHeaders headers)
		{
			return null;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:SdlChannelSink.cs

示例8: GetRequestStream

		public Stream GetRequestStream(IMessage requestMsg, ITransportHeaders requestHeaders)
		{
			// parameters validation
			if (requestHeaders == null)
				throw new ArgumentNullException("requestHeaders");

			IMethodCallMessage methodCall = requestMsg as IMethodCallMessage;
			if (methodCall == null)
				throw new NotSupportedException();

			if (_connection != null)
			{
				// close connection as it is probably not valid
				_connection.Close();
			}

			// get connection from the cache
			_connection = _connectionCache.GetConnection(_channelUri);

			try
			{
				// return stream for writing request
				return _connection.GetRequestStream(methodCall, requestHeaders);
			}
			catch
			{
				// close connection as it is probably not valid
				_connection.Close();
				_connection = null;
				throw;
			}
		}
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:32,代码来源:ClientTransportSink.cs

示例9: For

 public static ErrorReply For(IMessage message)
 {
     return new ErrorReply
     {
         ReplyFor = message.Id
     };
 }
开发者ID:hungdluit,项目名称:ChatterBox,代码行数:7,代码来源:ErrorReply.cs

示例10:

        void IMutateOutgoingTransportMessages.MutateOutgoing(IMessage[] messages, TransportMessage transportMessage)
        {
            if (transportMessage.Headers.ContainsKey(WindowsIdentityName))
                transportMessage.Headers.Remove(WindowsIdentityName);

            transportMessage.Headers.Add(WindowsIdentityName, Thread.CurrentPrincipal.Identity.Name);
        }
开发者ID:MaggiePlusPlus,项目名称:NServiceBus,代码行数:7,代码来源:ImpersonationManager.cs

示例11: DispatchReplyMessage

 public void DispatchReplyMessage(IMessage msg)
 {
     if (this._replySink != null)
     {
         this._replySink.SyncProcessMessage(msg);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ClientChannelSinkStack.cs

示例12: GetResponseStream

 public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack,
                                  object state,
                                  IMessage msg,
                                  ITransportHeaders headers)
 {
   throw new NotImplementedException();
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:IceServerTransportSink.cs

示例13: Post

        public Result Post(IMessage message)
        {
            try
            {
                var request = WebRequest.Create(message.Url) as HttpWebRequest;
                request.Method = "POST";

                foreach (string key in message.Headers.Keys)
                {
                    var value = message.Headers[key];

                    if (key == "content-type")
                    {
                        request.ContentType = value;
                        continue;
                    }

                    request.Headers.Add(key, value);
                }

                request.Headers.Add("submitted", this.TimeProvider.GetEpochInMilliSeconds(DateTimeKind.Utc).ToString(CultureInfo.InvariantCulture));

                return this.RequestAndRespond(request, message.Body);
            }
            catch (Exception)
            {
                return Result.PermanentError;
            }
        }
开发者ID:B2MSolutions,项目名称:reyna.net,代码行数:29,代码来源:HttpClient.cs

示例14: UiMessage

 public UiMessage(IMessage message, Contact contact)
 {
     Address = message.Address;
     Text = message.Text;
     TimeStamp = message.TimeStamp;
     Contact = contact;
 }
开发者ID:jcbozonier,项目名称:irontwit,代码行数:7,代码来源:UiMessage.cs

示例15: QSC

	///<summary>
	/// Creates a QSC.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public QSC(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Name of field");
		data[1] = new ID(message, 0,"Relational operator");
		data[2] = new ST(message,"Value");
		data[3] = new ID(message, 0,"Relational conjunction");
	}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:QSC.cs


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