Create() public static méthode

public static Create ( Type type ) : InterfacedObserver
type System.Type
Résultat InterfacedObserver
        public static NotificationMessage Notification <T>(Action <T> action)
            where T : IInterfacedObserver
        {
            var channel  = new SinkNotificationChannel();
            var observer = InterfacedObserver.Create(typeof(T));

            observer.Channel = channel;
            action((T)(object)observer);
            return(channel.Message);
        }
Exemple #2
0
        protected TObserver CreateObserver <TObserver>(object context = null)
            where TObserver : IInterfacedObserver
        {
            var observerId = 0;

            if (context != null)
            {
                var map = EnsureObserverMap();
                observerId = map.IssueId();
                map.AddContext(observerId, context);
            }

            var proxy = InterfacedObserver.Create(typeof(TObserver));

            proxy.ObserverId = observerId;
            proxy.Channel    = new AkkaReceiverNotificationChannel(Self);
            return((TObserver)(object)proxy);
        }