/// <summary> /// Observe the resource closest to the clicked location. /// </summary> private void ObserveResource() { // Reset the result text. txtResult.Text = "Starting\r\n"; if (__Observer == null) { __Observer = new CoApObserverGateway(); __Observer.ObserveResponseReceived += new CoApObserverGateway.ObserveResponseHandler(HandleObserveResponse); } // Drill into the device tree and fetch the related device name. __Observer.IpAddress = __DeviceName; __Observer.ServerPort = GatewaySettings.Instance.CoApPort; // Use the resource property for the target resource. __Observer.URI = txtURI.Text; btnStartStop.Text = "Stop"; __Observer.StartObserving(); }