Exemplo n.º 1
0
 public static T Create <T>(ProtocolDriver driver)
     where T : Message, new()
 {
     return(new T {
         Driver = driver
     });
 }
Exemplo n.º 2
0
        public static bool Send <T>(ProtocolDriver driver, Action <T> initMsg = null)
            where T : Message, new()
        {
            T _this = Create <T>(driver);

            if (initMsg != null)
            {
                initMsg(_this);
            }
            return(_this.Send());
        }
Exemplo n.º 3
0
        public static new Response Send <T>(ProtocolDriver driver, Action <T> initMsg = null)
            where T : Request, new()
        {
            T _this = Create <T>(driver);

            if (initMsg != null)
            {
                initMsg(_this);
            }
            return(_this.Send());
        }
Exemplo n.º 4
0
        public static ProtocolDriver Create(IMessageEventSink sink)
        {
            var _this = new ProtocolDriver();

            return(_this.Initialize(sink) ? _this : null);
        }