コード例 #1
0
        public IObservable AddObservable(ObservableIdentifier id)
        {
            Observable observable = new Observable(id, this);

            this.observables.Add(id, observable);
            return(observable);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public Observable(ObservableIdentifier id, ObservableCollection collection)
 {
     this.ID         = id;
     this.Collection = collection;
 }
コード例 #5
0
ファイル: AddObserver.cs プロジェクト: ratiel/Vindictus
 public AddObserver(ObservableIdentifier id)
 {
     this.ID = id;
 }
コード例 #6
0
ファイル: AddFail.cs プロジェクト: ratiel/Vindictus
 public AddFail(ObservableIdentifier id)
 {
     this.ID = id;
 }
コード例 #7
0
ファイル: AddOk.cs プロジェクト: ratiel/Vindictus
 public AddOk(ObservableIdentifier oid, int pid)
 {
     this.ObservableID = oid;
     this.ProxyID      = pid;
 }
コード例 #8
0
 public bool RemoveObservable(ObservableIdentifier id)
 {
     return(this.observables.Remove(id));
 }