Ejemplo n.º 1
0
        public User(AgentEventRectifier rectifier)
        {
            Id      = System.Guid.NewGuid().ToString();
            _Ghosts = new List <Tuple <Type, object> >();

            rectifier.SupplyEvent   += _Add;
            rectifier.UnsupplyEvent += _Remove;
            Dispose = () =>
            {
                rectifier.SupplyEvent   -= _Add;
                rectifier.UnsupplyEvent -= _Remove;
                (rectifier as IDisposable).Dispose();
            };
        }
Ejemplo n.º 2
0
        public System.Guid Bind(INotifierQueryable notifier)
        {
            AgentEventRectifier rectifier = new AgentEventRectifier(_WatchTypes, notifier);
            RectifierBinder     user      = new RectifierBinder(rectifier);

            _Users.Add(user);
            foreach (Tuple <Type, object> g in user.Ghosts)
            {
                _Register.Regist(g.Item1, g.Item2);
            }
            rectifier.SupplyEvent   += _Register.Regist;
            rectifier.UnsupplyEvent += (type, obj) => { _Register.Unregist(obj); };

            return(user.Id);
        }
Ejemplo n.º 3
0
        public User CreateUser(INotifierQueryable notifier)
        {
            AgentEventRectifier rectifier = new AgentEventRectifier(_WatchTypes, notifier);
            User user = new User(rectifier);

            _Users.Add(user);
            // todo _Updater.Add(user.Agent);
            foreach (Tuple <Type, object> g in user.Ghosts)
            {
                _Register.Regist(g.Item1, g.Item2);
            }
            rectifier.SupplyEvent   += _Register.Regist;
            rectifier.UnsupplyEvent += (type, obj) => { _Register.Unregist(obj); };

            return(user);
        }