本文整理汇总了C#中IMessageFactory类的典型用法代码示例。如果您正苦于以下问题:C# IMessageFactory类的具体用法?C# IMessageFactory怎么用?C# IMessageFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMessageFactory类属于命名空间,在下文中一共展示了IMessageFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connection
/// <summary>
/// Initializes a new instance of the <see cref="Connection"/> class.
/// </summary>
/// <param name="host">Hostname of the server</param>
/// <param name="port">Port on which the server is listening</param>
/// <param name="messageFactory">Protobuf message factory</param>
public Connection(string host, int port, IMessageFactory messageFactory)
{
this.host = host;
this.port = port;
this.messageFactory = messageFactory;
this.Connected = false;
}
示例2: SessionFactory
public SessionFactory(IApplication app, IMessageStoreFactory storeFactory, ILogFactory logFactory, IMessageFactory messageFactory)
{
application_ = app;
messageStoreFactory_ = storeFactory;
logFactory_ = logFactory;
messageFactory_ = messageFactory ?? new DefaultMessageFactory();
}
示例3: ConnectedState
public ConnectedState(RC4Encryptor encryptor, IMessageFactory messageFactory)
{
this.encryptor = encryptor;
this.messageFactory = messageFactory;
this.compressor = new LZ4Compressor();
}
示例4: Initialize
private static void Initialize()
{
_messageFactory = TweetinviContainer.Resolve<IMessageFactory>();
_messageController = TweetinviContainer.Resolve<IMessageController>();
_messageGetLatestsReceivedRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsReceivedRequestParameters>>();
_messageGetLatestsSentRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsSentRequestParameters>>();
}
示例5: MessageController
public MessageController(
IMessageQueryExecutor messageQueryExecutor,
IMessageFactory messageFactory)
{
_messageQueryExecutor = messageQueryExecutor;
_messageFactory = messageFactory;
}
示例6: OpenIdChannel
/// <summary>
/// Initializes a new instance of the <see cref="OpenIdChannel"/> class.
/// </summary>
/// <param name="messageTypeProvider">A class prepared to analyze incoming messages and indicate what concrete
/// message types can deserialize from it.</param>
/// <param name="bindingElements">The binding elements to use in sending and receiving messages.</param>
protected OpenIdChannel(IMessageFactory messageTypeProvider, IChannelBindingElement[] bindingElements)
: base(messageTypeProvider, bindingElements) {
Requires.NotNull(messageTypeProvider, "messageTypeProvider");
// Customize the binding element order, since we play some tricks for higher
// security and backward compatibility with older OpenID versions.
var outgoingBindingElements = new List<IChannelBindingElement>(bindingElements);
var incomingBindingElements = new List<IChannelBindingElement>(bindingElements);
incomingBindingElements.Reverse();
// Customize the order of the incoming elements by moving the return_to elements in front.
var backwardCompatibility = incomingBindingElements.OfType<BackwardCompatibilityBindingElement>().SingleOrDefault();
var returnToSign = incomingBindingElements.OfType<ReturnToSignatureBindingElement>().SingleOrDefault();
if (backwardCompatibility != null) {
incomingBindingElements.MoveTo(0, backwardCompatibility);
}
if (returnToSign != null) {
// Yes, this is intentionally, shifting the backward compatibility
// binding element to second position.
incomingBindingElements.MoveTo(0, returnToSign);
}
this.CustomizeBindingElementOrder(outgoingBindingElements, incomingBindingElements);
// Change out the standard web request handler to reflect the standard
// OpenID pattern that outgoing web requests are to unknown and untrusted
// servers on the Internet.
this.WebRequestHandler = new UntrustedWebRequestHandler();
}
示例7: OrderController
public OrderController(IRepository<Order> orderRepository, IMessageFactory messageFactory)
{
Check.Require(orderRepository != null);
_orderRepository = orderRepository;
_messageFactory = messageFactory;
}
示例8: Login
public static async Task<Message> Login(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatLoginLoginRequest)input;
var retVal = await ((IChatLogin)target).Login(msg.name);
var retMsg = msgFactory.New<IChatLoginLoginReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例9: GetRooms
public static async Task<Message> GetRooms(IMessageFactory msgFactory, object target, Message input)
{
var msg = (IChatServiceGetRoomsRequest)input;
var retVal = await ((IChatService)target).GetRooms();
var retMsg = msgFactory.New<IChatServiceGetRoomsReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例10: Complex
public static async Task<Message> Complex(IMessageFactory msgFactory, object target, Message input)
{
var msg = (ISomeServiceComplexRequest)input;
var retVal = await ((ISomeService)target).Complex(msg.requestId, msg.data, msg.name, msg.datas);
var retMsg = msgFactory.New<ISomeServiceComplexReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例11: Simple
public static async Task<Message> Simple(IMessageFactory msgFactory, object target, Message input)
{
var msg = (ISomeServiceSimpleRequest)input;
var retVal = await ((ISomeService)target).Simple(msg.requestId);
var retMsg = msgFactory.New<ISomeServiceSimpleReply>();
retMsg.RetVal = retVal;
return retMsg;
}
示例12: SocketInitiator
public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory, IMessageFactory messageFactory)
: base(application, storeFactory, settings, logFactory, messageFactory)
{
app_ = application;
storeFactory_ = storeFactory;
settings_ = settings;
logFactory_ = logFactory;
}
示例13: Session
public Session(
IApplication app, IMessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider,
SessionSchedule sessionSchedule, int heartBtInt, ILogFactory logFactory, IMessageFactory msgFactory, string senderDefaultApplVerID)
{
this.Application = app;
this.SessionID = sessID;
this.DataDictionaryProvider = new DataDictionaryProvider(dataDictProvider);
this.schedule_ = sessionSchedule;
this.msgFactory_ = msgFactory;
this.SenderDefaultApplVerID = senderDefaultApplVerID;
this.SessionDataDictionary = this.DataDictionaryProvider.GetSessionDataDictionary(this.SessionID.BeginString);
if (this.SessionID.IsFIXT)
this.ApplicationDataDictionary = this.DataDictionaryProvider.GetApplicationDataDictionary(this.SenderDefaultApplVerID);
else
this.ApplicationDataDictionary = this.SessionDataDictionary;
ILog log;
if (null != logFactory)
log = logFactory.Create(sessID);
else
log = new NullLog();
state_ = new SessionState(log, heartBtInt)
{
MessageStore = storeFactory.Create(sessID)
};
// Configuration defaults.
// Will be overridden by the SessionFactory with values in the user's configuration.
this.PersistMessages = true;
this.ResetOnDisconnect = false;
this.SendRedundantResendRequests = false;
this.ValidateLengthAndChecksum = true;
this.CheckCompID = true;
this.MillisecondsInTimeStamp = true;
this.EnableLastMsgSeqNumProcessed = false;
this.MaxMessagesInResendRequest = 0;
this.SendLogoutBeforeTimeoutDisconnect = false;
this.IgnorePossDupResendRequests = false;
this.RequiresOrigSendingTime = true;
this.CheckLatency = true;
this.MaxLatency = 120;
if (!IsSessionTime)
Reset("Out of SessionTime (Session construction)");
else if (IsNewSession)
Reset("New session");
lock (sessions_)
{
sessions_[this.SessionID] = this;
}
this.Application.OnCreate(this.SessionID);
this.Log.OnEvent("Created session");
}
示例14: ServeController
public ServeController(IServeService serveService, IConfigurationWrapper configuration, IMessageFactory messageFactory, IMessageQueueFactory messageQueueFactory)
{
_serveService = serveService;
_messageFactory = messageFactory;
var eventQueueName = configuration.GetConfigValue("SignupToServeEventQueue");
_eventQueue = messageQueueFactory.CreateQueue(eventQueueName, QueueAccessMode.Send);
_messageFactory = messageFactory;
}
示例15: OAuthChannel
/// <summary>
/// Initializes a new instance of the <see cref="OAuthChannel"/> class.
/// </summary>
/// <param name="signingBindingElement">The binding element to use for signing.</param>
/// <param name="store">The web application store to use for nonces.</param>
/// <param name="tokenManager">The ITokenManager instance to use.</param>
/// <param name="messageTypeProvider">
/// An injected message type provider instance.
/// Except for mock testing, this should always be one of
/// <see cref="OAuthConsumerMessageFactory"/> or <see cref="OAuthServiceProviderMessageFactory"/>.
/// </param>
internal OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, ITokenManager tokenManager, IMessageFactory messageTypeProvider)
: base(messageTypeProvider, InitializeBindingElements(signingBindingElement, store, tokenManager)) {
Contract.Requires<ArgumentNullException>(tokenManager != null);
Contract.Requires<ArgumentNullException>(signingBindingElement != null);
Contract.Requires<ArgumentException>(signingBindingElement.SignatureCallback == null, OAuthStrings.SigningElementAlreadyAssociatedWithChannel);
this.TokenManager = tokenManager;
signingBindingElement.SignatureCallback = this.SignatureCallback;
}