示例#1
0
        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();
        }
示例#2
0
        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); });
        }
示例#3
0
        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;
            }
        }