Ejemplo n.º 1
0
        /// <summary>
        /// Factory for creating the Touch Portal client.
        /// </summary>
        /// <param name="eventHandler">Handler the events from Touch Portal, normally the plugin instance.</param>
        /// <param name="options">Optional options, if null, default values are selected.</param>
        /// <param name="loggerFactory">Optional logger factory, if null, no logger is created.</param>
        /// <returns></returns>
        public static ITouchPortalClient CreateClient(ITouchPortalEventHandler eventHandler, TouchPortalOptions options = null, ILoggerFactory loggerFactory = null)
        {
            ITouchPortalClientFactory factory = new TouchPortalFactory(options, loggerFactory);

            return(factory.Create(eventHandler));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Private so we don't expose the socket factory.
 /// </summary>
 public TouchPortalFactory(TouchPortalOptions options, ILoggerFactory loggerFactory)
 {
     _loggerFactory = loggerFactory;
     _options       = options ?? new TouchPortalOptions();
 }