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(); }
private async void NotifyFoundAsync(DeviceInfo info, Action<DeviceInfo> OnServerFound) { #if WINDOWS_PHONE await Task.Run(() => { }); // avoid warning for async directive. Deployment.Current.Dispatcher.BeginInvoke(() => #else await CoreWindow.GetForCurrentThread().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => #endif { OnServerFound.Invoke(info); }); }
public void Refresh() { CloseLiveviewConnection(); watch = new Stopwatch(); watch.Start(); DeviceInfo = null; if (observer != null) { observer.Stop(); observer = null; } IntervalManager = new IntervalShootingManager(AppStatus.GetInstance()); if (IntervalManager.ActTakePicture == null) { IntervalManager.ActTakePicture += this.RequestActTakePicture; } }