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


C# IMessageFactory类代码示例

本文整理汇总了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;
 }
开发者ID:sshipsey,项目名称:Mumble.NET,代码行数:13,代码来源:Connection.cs

示例2: SessionFactory

 public SessionFactory(IApplication app, IMessageStoreFactory storeFactory, ILogFactory logFactory, IMessageFactory messageFactory)
 {
     application_ = app;
     messageStoreFactory_ = storeFactory;
     logFactory_ = logFactory;
     messageFactory_ = messageFactory ?? new DefaultMessageFactory();
 }
开发者ID:dafanasiev,项目名称:quickfixn,代码行数:7,代码来源:SessionFactory.cs

示例3: ConnectedState

        public ConnectedState(RC4Encryptor encryptor, IMessageFactory messageFactory)
        {
            this.encryptor = encryptor;
            this.messageFactory = messageFactory;

            this.compressor = new LZ4Compressor();
        }
开发者ID:puppt,项目名称:GW2Emu,代码行数:7,代码来源:ConnectedState.cs

示例4: Initialize

 private static void Initialize()
 {
     _messageFactory = TweetinviContainer.Resolve<IMessageFactory>();
     _messageController = TweetinviContainer.Resolve<IMessageController>();
     _messageGetLatestsReceivedRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsReceivedRequestParameters>>();
     _messageGetLatestsSentRequestParametersFactory = TweetinviContainer.Resolve<IFactory<IMessageGetLatestsSentRequestParameters>>();
 }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:7,代码来源:Message.cs

示例5: MessageController

 public MessageController(
     IMessageQueryExecutor messageQueryExecutor,
     IMessageFactory messageFactory)
 {
     _messageQueryExecutor = messageQueryExecutor;
     _messageFactory = messageFactory;
 }
开发者ID:SowaLabs,项目名称:TweetinviNew,代码行数:7,代码来源:MessageController.cs

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

示例7: OrderController

        public OrderController(IRepository<Order> orderRepository, IMessageFactory messageFactory)
        {
            Check.Require(orderRepository != null);

            _orderRepository = orderRepository;
            _messageFactory = messageFactory;
        }
开发者ID:anlai,项目名称:UCDArch,代码行数:7,代码来源:OrderController.cs

示例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;
		}
开发者ID:tlotter,项目名称:MassiveOnlineUniversalServerEngine,代码行数:8,代码来源:GeneratedDomain.cs

示例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;
		}
开发者ID:tlotter,项目名称:MassiveOnlineUniversalServerEngine,代码行数:8,代码来源:GeneratedDomain.cs

示例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;
		}
开发者ID:tlotter,项目名称:MassiveOnlineUniversalServerEngine,代码行数:8,代码来源:GeneratedDomain.cs

示例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;
		}
开发者ID:tlotter,项目名称:MassiveOnlineUniversalServerEngine,代码行数:8,代码来源:GeneratedDomain.cs

示例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;
 }
开发者ID:BobRoss79,项目名称:quickfixn,代码行数:8,代码来源:SocketInitiator.cs

示例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");
        }
开发者ID:huruixd,项目名称:quickfixn,代码行数:58,代码来源:Session.cs

示例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;
        }
开发者ID:plachmann,项目名称:crds-angular,代码行数:9,代码来源:ServeController.cs

示例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;
		}
开发者ID:jsmale,项目名称:dotnetopenid,代码行数:20,代码来源:OAuthChannel.cs


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