public EventObserver(CameraServiceClient10 client) { this.client = client; }
private void SearchButton_Click(object sender, RoutedEventArgs e) { finder.SearchDevices(10, (info) => { Debug.WriteLine("DeviceFound: " + info.UDN); if (info.Endpoints.Keys.Contains("camera")) { client = new CameraServiceClient10(info.Endpoints["camera"]); } data.add("DeviceFound: " + info.UDN); }, () => { Debug.WriteLine("Search Timeout"); data.add("SSDP timeout"); }); }
private void OnServerFound(DeviceInfo di, Action Found) { DeviceInfo = di; Debug.WriteLine("found device: " + DeviceInfo.ModelName); if (DeviceInfo.Endpoints.ContainsKey("camera")) { client = new CameraServiceClient10(di.Endpoints["camera"]); Debug.WriteLine(di.Endpoints["camera"]); GetMethodTypes(Found); cameraStatus.isAvailableConnecting = true; observer = new EventObserver(client); } // TODO be careful, device info is updated to the latest found device. NoticeUpdate(); }