public IObservable AddObservable(ObservableIdentifier id) { Observable observable = new Observable(id, this); this.observables.Add(id, observable); return(observable); }
public Observer(EntityConnection connection, ObservableIdentifier target) { Observer observer = this; if (connection.State == EntityConnection.ConnectionState.Closed || connection.State == EntityConnection.ConnectionState.Bound) { Log <Observer> .Logger.ErrorFormat("Try to add observer to {1} connection : [{0}]", target, connection.State); return; } this.Conn = connection; this.IsDirty = true; this.Conn.RegisterMessageHandler(typeof(AddOk), new Action <EntityConnection, object>(this.AddOkHandler)); this.Conn.RegisterMessageHandler(typeof(AddFail), new Action <EntityConnection, object>(this.AddFailHandler)); this.Conn.Closed += new EventHandler <EventArgs <IEntityProxy> >(this.Connection_Closed); if (this.Conn.State == EntityConnection.ConnectionState.Connected) { this.Conn.SendMessage(new AddObserver(target)); } else { this.Conn.ConnectionSucceeded += delegate(object sender, EventArgs <IEntityProxy> e) { observer.Conn.SendMessage(new AddObserver(target)); }; } this.Target = target; }
public override bool Equals(object obj) { if (base.GetType() != obj.GetType()) { return(false); } ObservableIdentifier observableIdentifier = (ObservableIdentifier)obj; return(this.ID == observableIdentifier.ID && this.Category == observableIdentifier.Category); }
public Observable(ObservableIdentifier id, ObservableCollection collection) { this.ID = id; this.Collection = collection; }
public AddObserver(ObservableIdentifier id) { this.ID = id; }
public AddFail(ObservableIdentifier id) { this.ID = id; }
public AddOk(ObservableIdentifier oid, int pid) { this.ObservableID = oid; this.ProxyID = pid; }
public bool RemoveObservable(ObservableIdentifier id) { return(this.observables.Remove(id)); }