Example #1
0
 void _Proxy_AfterRecreateProxy(object sender, EventArgs e)
 {
     _Proxy.Subscribe();
     // marshal UI work to UI thread
     this._SyncContext.Post((x) =>
     {
         GetData();
     }, null
                            );
 }
Example #2
0
        private void InitializeProxy()
        {
            try
            {
                Trace.WriteLine(string.Format("Initializing proxy on thread {0}", Thread.CurrentThread.GetHashCode()));

                TodoListCallback callback = new TodoListCallback(this);
                this.Title = string.Format("Todo List Client: Thread ID {0}", Thread.CurrentThread.GetHashCode());


                _Proxy = new TodoListServiceDuplexProxy <TodoListCallback>(callback, "default");
                _Proxy.AfterRecreateProxy += new EventHandler(_Proxy_AfterRecreateProxy);
                _Proxy.Subscribe();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        private void InitializeProxy()
        {
                try
                {
                    Trace.WriteLine(string.Format("Initializing proxy on thread {0}", Thread.CurrentThread.GetHashCode()));

                    TodoListCallback callback = new TodoListCallback(this);
                    this.Title = string.Format("Todo List Client: Thread ID {0}", Thread.CurrentThread.GetHashCode());

                 
                    _Proxy = new TodoListServiceDuplexProxy<TodoListCallback>(callback,"default");
                    _Proxy.AfterRecreateProxy += new EventHandler(_Proxy_AfterRecreateProxy);
                    _Proxy.Subscribe();

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

        }