예제 #1
0
        private async Task Dispatch(object command, Connection connection, Type baseInteface)
        {
            var type = baseInteface.MakeGenericType(command.GetType());

            if (command is IReWorkSystemMessage && !_activator.HasRegistration(type))
            {
                return;
            }

            var instance = _activator.GetInstance(type);
            var method   = type.GetMethod("Handle");

            if (method != null)
            {
                await(Task) method.Invoke(instance, new[] { command, connection });
            }
        }
예제 #2
0
 private IConnectionManager Start()
 {
     return(_activator.GetInstance <IConnectionManager>());
 }