void OnCameraDisconnected(object sender, EventArgs e) { IsAppEnabled = false; ToastNotificationString notification = new ToastNotificationString("Disconnected!", "The camera has been disconnected.", DateTimeOffset.Now.AddMinutes(1)); CurrentStatus = "The camera has been disconnected."; notification.Show(); }
async void OnCameraConnected(object sender, EventArgs e) { IsAppEnabled = true; GetImageButtonEnabled = true; ToastNotificationString notification = new ToastNotificationString("Connected!", "The camera has been connected.", DateTimeOffset.Now.AddMinutes(1)); CurrentStatus = "The camera has been connected."; notification.Show(); //************************************************************************************ ////TODO: commented temporarelly //string strSerialNumber = _camera.SerialNumber; //string strCalibration = ""; //string fileName = DateTime.Now.ToString("yyyyMMdd-HHmmss"); //fileName += "-Calibration" + strSerialNumber + ".xml"; //try //{ // StorageFile file = await KnownFolders.SavedPictures.CreateFileAsync(fileName); // await FileIO.WriteTextAsync(file, strCalibration); //} //catch (UnauthorizedAccessException e1) //{ // Debug.WriteLine("Failed to create file \"" + fileName + "\": " + e1.Message); //} //catch (Exception e2) //{ // Debug.WriteLine("Exception: " + e2.Message); //} //************************************************************************* //System.IO.File.WriteAllText(fileName, strCalibration); /*if (!string.IsNullOrEmpty(strCalibration)) * { * DeviceCalibration = XmlSerializationUtil.FromXml<SpectrometerCalibration>(strCalibration); * }*/ }