示例#1
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);
            }
        }
示例#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);
                }

        }