Пример #1
0
 /// <summary>
 /// Build all dependant types into the messaging server
 /// </summary>
 /// <param name="type"></param>
 public void BuildRoutes([NotNull] Type type)
 {
     if (type == null)
     {
         throw new ArgumentNullException(nameof(type));
     }
     if (type.IsInterface)
     {
         router.AddSource(type.FullName, InterfaceStack.OfInterface(type));
     }
     AddSourcesAndRoute(type);
 }
Пример #2
0
        void AddSourcesAndRoute([NotNull] Type type)
        {
            var interfaces = type.DirectlyImplementedInterfaces();

            if (interfaces == null)
            {
                return;
            }

            foreach (var interfaceType in interfaces)
            {
                router.AddSource(interfaceType.FullName, InterfaceStack.OfInterface(interfaceType));
                router.RouteSources(type.FullName, interfaceType.FullName);
                AddSourcesAndRoute(interfaceType);
            }
        }
Пример #3
0
 public void Deactivate()
 {
     Active = false;
     InterfaceStack.PopInterface();
 }
Пример #4
0
 public void Activate()
 {
     Active = true;
     InterfaceStack.PushInterface(Interface);
 }