本文整理汇总了C#中IMessage类的典型用法代码示例。如果您正苦于以下问题:C# IMessage类的具体用法?C# IMessage怎么用?C# IMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMessage类属于命名空间,在下文中一共展示了IMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: VR
///<summary>
/// Creates a VR.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public VR(IMessage message, string description)
: base(message, description)
{
data = new IType[2];
data[0] = new ST(message,"First Data Code Value");
data[1] = new ST(message,"Last Data Code Value");
}
开发者ID:snosrap,项目名称:nhapi,代码行数:12,代码来源:VR.cs
示例17: Equals
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
public bool Equals(IMessage other)
{
bool result = other.DateTime == DateTime && other.From == From && other.To == To
&& other.MessageText == MessageText;
return result;
}
开发者ID:Bhavesh-Patel,项目名称:TextMessageViewer,代码行数:10,代码来源:Message.cs
示例18: Broadcast
public void Broadcast(IMessage message)
{
if (IsEnabled)
{
ThreadPool.QueueUserWorkItem(SendTweet, message.GetMessage(140));
}
}
开发者ID:Jc54,项目名称:PlayMe,代码行数:7,代码来源:TwitterBroadcaster.cs
示例19: SN
///<summary>
/// Creates a SN.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public SN(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new ST(message,"Comparator");
data[1] = new NM(message,"Num1");
data[2] = new ST(message,"Separator or suffix");
data[3] = new NM(message,"Num2");
}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:SN.cs
示例20: Process
public void Process(IMessage message)
{
if (IsFlowInputMessage(message))
{
// parent/flow.port => flow/.port
var output = new Message(Port.Build(message.Port.OperationName, "", message.Port.Name), message.Data, message.CorrelationId)
{
Causalities = message.Causalities,
FlowStack = message.FlowStack
};
if (message.Port.Path != "") output.FlowStack.Push(message.Port.Path);
Result(output);
}
else
{
// flow/.port => parent/flow.port
var parentFlowname = "";
if (!message.FlowStack.IsEmpty) parentFlowname = message.FlowStack.Pop();
var output = new Message(Port.Build(parentFlowname, Create_operation_name(message), message.Port.Name), message.Data, message.CorrelationId)
{
Causalities = message.Causalities,
FlowStack = message.FlowStack
};
Result(output);
}
}
开发者ID:fstandhartinger,项目名称:NPantaRhei,代码行数:30,代码来源:Process_message.cs
注:本文中的IMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论