Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            BroadcastorCallback cb = new BroadcastorCallback();

            cb.SetHandler(this.HandleBroadcast);
        }
Exemplo n.º 2
0
        private void btnRegisterClient_Click(object sender, RoutedEventArgs e)
        {
            if ((this._client != null))
            {
                this._client.Abort();
                this._client = null;
            }

            BroadcastorCallback cb = new BroadcastorCallback();

            cb.SetHandler(this.HandleBroadcast);

            System.ServiceModel.InstanceContext context =
                new System.ServiceModel.InstanceContext(cb);
            this._client =
                new ServiceReference1.Service1Client(context);

            this._client.RegisterClient(this.txtClientName.Text);
        }