void timer_Tick(object sender, EventArgs e) { string title = "Time to stretch"; string text = "Get out of your chair, you lazy bum!"; MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon); }
private void startBtn_Click(object sender, RoutedEventArgs e) { if (!sd.readGeData().Equals("")) { if (startBtn.Content.Equals("Start")) { gEarth = Process.Start(sd.readGeData()); this.WindowState = WindowState.Minimized; MyNotifyIcon.Visibility = Visibility.Visible; MyNotifyIcon.ShowBalloonTip("Pedometer", "pedometer is start controling your computer....", BalloonIcon.Info); control = true; startBtn.Content = "Stop"; form1 = new monitor(); form1.Show(); } else { MyNotifyIcon.ShowBalloonTip("Pedometer", "pedometer stop", BalloonIcon.Info); MyNotifyIcon.Visibility = Visibility.Hidden; control = false; startBtn.Content = "Start"; } } else { MessageBox.Show("Please select the google earth first!"); SystemSounds.Beep.Play(); } }
private void ShowStandardBalloon(string title, string text, string iconColour) { ChangeIcon(iconColour); //show balloon with custom icon BalloonIcon icon = BalloonIcon.Error; switch (iconColour) { case "red": icon = BalloonIcon.Error; break; case "green": icon = BalloonIcon.Info; break; case "yellow": case "grey": icon = BalloonIcon.Warning; break; } MyNotifyIcon.ShowBalloonTip(title, text, icon); MyNotifyIcon.ToolTipText = title; //hide balloon //MyNotifyIcon.HideBalloonTip(); }
private void btnShowStandardBalloon_Click(object sender, RoutedEventArgs e) { string title = "WPF NotifyIcon"; string text = "This is a standard balloon"; MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon); }
private void MenuItem_Click_1(object sender, RoutedEventArgs e) { this.WindowState = WindowState.Normal; MyNotifyIcon.ShowBalloonTip("Pedometer", "pedometer stop", BalloonIcon.Info); MyNotifyIcon.Visibility = Visibility.Hidden; control = false; startBtn.Content = "Start"; }
private void Form1_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { MyNotifyIcon.Visible = true; MyNotifyIcon.ShowBalloonTip(3000); this.ShowInTaskbar = false; } }
private void Window_StateChanged(object sender, EventArgs e) { if (WindowState == WindowState.Minimized && ServiceProvider.Settings.MinimizeToTrayIcon && !ServiceProvider.Settings.HideTrayNotifications) { this.Hide(); MyNotifyIcon.HideBalloonTip(); MyNotifyIcon.ShowBalloonTip("digiCamControl", "Application was minimized \n Double click to restore", BalloonIcon.Info); } }
private void ShowStandardBalloon(string text) { string title = "DS4 Control Panel"; MyNotifyIcon.ShowBalloonTip(title, text, BalloonIcon.Info); //MyNotifyIcon.ShowBalloonTip(title, text, BalloonIcon.Warning); //MyNotifyIcon.ShowBalloonTip(title, text, BalloonIcon.Error); //hide balloon //MyNotifyIcon.HideBalloonTip(); }
void DeviceManager_CameraDisconnected(ICameraDevice cameraDevice) { Dispatcher.BeginInvoke(new Action(() => { if (!ServiceProvider.Settings.HideTrayNotifications) { MyNotifyIcon.HideBalloonTip(); MyNotifyIcon.ShowBalloonTip("Camera disconnected", cameraDevice.LoadProperties().DeviceName, BalloonIcon.Info); } })); }
public MainWindow() { if (VerificaProgramaEmExecucao()) { MessageBoxResult result = System.Windows.MessageBox.Show("O Programa já está em Execução!", "Atenção Operador.", MessageBoxButton.OK, MessageBoxImage.Error); if (result == MessageBoxResult.OK) { System.Windows.Application.Current.Shutdown(); } } else { InitializeComponent(); MyNotifyIcon.TrayMouseDoubleClick += MyNotifyIcon_TrayMouseDoubleClick; MyNotifyIcon.ShowBalloonTip("Atualizador - WinSGM", "O atualizador foi iníciado.", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info); } //System.Threading.Mutex hSolution = null; //// verifica se programa já está rodando //try //{ // hSolution = System.Threading.Mutex.OpenExisting("Atualizador.exe"); //} //catch (System.Threading.WaitHandleCannotBeOpenedException) //{ // // Não existe Instancia do programa aberto //} //if (hSolution == null) //{ // hSolution = new System.Threading.Mutex(true, "Atualizador.exe"); // InitializeComponent(); // MyNotifyIcon.TrayMouseDoubleClick += MyNotifyIcon_TrayMouseDoubleClick; // MyNotifyIcon.ShowBalloonTip("Atualizador - WinSGM", "O atualizador foi iníciado.", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info); //} //else //{ // MessageBoxResult result = System.Windows.MessageBox.Show("O Programa já está em Execução!", // "Atenção Operador.", // MessageBoxButton.OK, // MessageBoxImage.Error); // if (result == MessageBoxResult.OK) // { // System.Windows.Application.Current.Shutdown(); // } //} }
private void MainForm_Deactivate(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) { ShowInTaskbar = false; Hide(); if (!Cfg.Autostart) { MyNotifyIcon.ShowBalloonTip(1000, "", Resources.MainForm_Service_is_running, ToolTipIcon.Info); } } }
private void Window_StateChanged(object sender, EventArgs e) { if (WindowState == WindowState.Minimized) { if (PrimeiraVez == true) { MyNotifyIcon.ShowBalloonTip("Atualizador - WinSGM", "O atualizador foi minimizado mas está rodando em segundo plano.", Hardcodet.Wpf.TaskbarNotification.BalloonIcon.Info); } PrimeiraVez = true; ShowInTaskbar = false; Hide(); } }
private void PomodoroFormResize(object sender, EventArgs e) { if (FormWindowState.Minimized == WindowState) { MyNotifyIcon.Visible = true; MyNotifyIcon.ShowBalloonTip(200); Hide(); } else if (FormWindowState.Normal == WindowState) { MyNotifyIcon.Visible = false; } }
void LockScreen(object sender, ElapsedEventArgs e) { if (!CheckWindowsFullscreen.IsForegroundFullScreen()) { MyNotifyIcon.Visible = true; MyNotifyIcon.BalloonTipText = CurrentUsername.Split('\\')[1] + " ơi đứng dạy vận động nào, ngồi nhiều không tốt đâu ^^\"!"; MyNotifyIcon.ShowBalloonTip(3000); Thread.Sleep(10000); this.BeginInvoke(new MethodInvoker(delegate { WindowsHelper.MonitorOff(this.Handle); })); WindowsHelper.LockWorkStation(); TimeSpan time = new TimeSpan(0, 0, 5); WindowsHelper.BlockInput(time); } }
private void frmMainForm_Resize(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Minimized) { MyNotifyIcon.Visible = true; if (_isFirstTime) { if (!_isClickSaveButton) { btnSave_Click(null, null); } MyNotifyIcon.ShowBalloonTip(3000); _isFirstTime = false; } this.ShowInTaskbar = false; this.Hide(); } }
/// <summary> /// Photoes the captured. /// </summary> /// <param name="o">The o.</param> private void PhotoCaptured(object o) { PhotoCapturedEventArgs eventArgs = o as PhotoCapturedEventArgs; if (eventArgs == null) { return; } try { Log.Debug("Photo transfer begin."); eventArgs.CameraDevice.IsBusy = true; var extension = Path.GetExtension(eventArgs.FileName); // the capture is for live view preview if (LiveViewManager.PreviewRequest.ContainsKey(eventArgs.CameraDevice) && LiveViewManager.PreviewRequest[eventArgs.CameraDevice]) { LiveViewManager.PreviewRequest[eventArgs.CameraDevice] = false; var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + extension); eventArgs.CameraDevice.TransferFile(eventArgs.Handle, file); eventArgs.CameraDevice.IsBusy = false; eventArgs.CameraDevice.TransferProgress = 0; eventArgs.CameraDevice.ReleaseResurce(eventArgs.Handle); LiveViewManager.Preview[eventArgs.CameraDevice] = file; LiveViewManager.OnPreviewCaptured(eventArgs.CameraDevice, file); return; } CameraProperty property = eventArgs.CameraDevice.LoadProperties(); PhotoSession session = (PhotoSession)eventArgs.CameraDevice.AttachedPhotoSession ?? ServiceProvider.Settings.DefaultSession; StaticHelper.Instance.SystemMessage = ""; if (!eventArgs.CameraDevice.CaptureInSdRam || PhotoUtils.IsMovie(eventArgs.FileName)) { if (property.NoDownload) { eventArgs.CameraDevice.IsBusy = false; eventArgs.CameraDevice.ReleaseResurce(eventArgs.Handle); return; } if (extension != null && (session.DownloadOnlyJpg && extension.ToLower() != ".jpg")) { eventArgs.CameraDevice.IsBusy = false; eventArgs.CameraDevice.ReleaseResurce(eventArgs.Handle); return; } } StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferBegin; string tempFile = Path.GetTempFileName(); if (File.Exists(tempFile)) { File.Delete(tempFile); } Stopwatch stopWatch = new Stopwatch(); // transfer file from camera to temporary folder // in this way if the session folder is used as hot folder will prevent write errors stopWatch.Start(); if (!eventArgs.CameraDevice.CaptureInSdRam && session.DownloadThumbOnly) { eventArgs.CameraDevice.TransferFileThumb(eventArgs.Handle, tempFile); } else { eventArgs.CameraDevice.TransferFile(eventArgs.Handle, tempFile); } eventArgs.CameraDevice.TransferProgress = 0; eventArgs.CameraDevice.IsBusy = false; stopWatch.Stop(); string strTransfer = "Transfer time : " + stopWatch.Elapsed.TotalSeconds.ToString("##.###") + " Speed :" + Math.Round( new System.IO.FileInfo(tempFile).Length / 1024.0 / 1024 / stopWatch.Elapsed.TotalSeconds, 2) + " Mb/s"; Log.Debug(strTransfer); string fileName = ""; if (!session.UseOriginalFilename || eventArgs.CameraDevice.CaptureInSdRam) { fileName = session.GetNextFileName(eventArgs.FileName, eventArgs.CameraDevice, tempFile); } else { fileName = Path.Combine(session.Folder, eventArgs.FileName); if (File.Exists(fileName) && !session.AllowOverWrite) { fileName = StaticHelper.GetUniqueFilename( Path.GetDirectoryName(fileName) + "\\" + Path.GetFileNameWithoutExtension(fileName) + "_", 0, Path.GetExtension(fileName)); } } if (session.AllowOverWrite && File.Exists(fileName)) { PhotoUtils.WaitForFile(fileName); File.Delete(fileName); } // make lower case extension if (session.LowerCaseExtension && !string.IsNullOrEmpty(Path.GetExtension(fileName))) { fileName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + Path.GetExtension(fileName).ToLower()); } if (session.AskSavePath) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "All files|*.*"; dialog.Title = "Save captured photo"; dialog.FileName = fileName; dialog.InitialDirectory = Path.GetDirectoryName(fileName); if (dialog.ShowDialog() == true) { fileName = dialog.FileName; } else { eventArgs.CameraDevice.IsBusy = false; if (File.Exists(tempFile)) { File.Delete(tempFile); } return; } } if (!Directory.Exists(Path.GetDirectoryName(fileName))) { Directory.CreateDirectory(Path.GetDirectoryName(fileName)); } string backupfile = null; if (session.BackUp) { backupfile = session.CopyBackUp(tempFile, fileName); if (string.IsNullOrEmpty(backupfile)) { StaticHelper.Instance.SystemMessage = "Unable to save the backup"; } } // execute plugins which are executed before transfer if (ServiceProvider.Settings.DefaultSession.AutoExportPluginConfigs.Count((x) => !x.RunAfterTransfer) > 0) { FileItem tempitem = new FileItem(tempFile); tempitem.Name = Path.GetFileName(fileName); tempitem.BackupFileName = backupfile; tempitem.Series = session.Series; tempitem.AddTemplates(eventArgs.CameraDevice, session); ExecuteAutoexportPlugins(eventArgs.CameraDevice, tempitem, false); } if ((!eventArgs.CameraDevice.CaptureInSdRam || PhotoUtils.IsMovie(fileName)) && session.DeleteFileAfterTransfer) { eventArgs.CameraDevice.DeleteObject(new DeviceObject() { Handle = eventArgs.Handle }); } File.Copy(tempFile, fileName); if (File.Exists(tempFile)) { PhotoUtils.WaitForFile(tempFile); File.Delete(tempFile); } if (session.WriteComment) { if (!string.IsNullOrEmpty(session.Comment)) { Exiv2Helper.SaveComment(fileName, session.Comment); } if (session.SelectedTag1 != null && !string.IsNullOrEmpty(session.SelectedTag1.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag1.Value); } if (session.SelectedTag2 != null && !string.IsNullOrEmpty(session.SelectedTag2.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag2.Value); } if (session.SelectedTag3 != null && !string.IsNullOrEmpty(session.SelectedTag3.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag3.Value); } if (session.SelectedTag4 != null && !string.IsNullOrEmpty(session.SelectedTag4.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag4.Value); } } if (session.ExternalData != null) { session.ExternalData.FileName = fileName; } // prevent crash og GUI when item count updated Dispatcher.Invoke(new Action(delegate { try { _selectedItem = session.GetNewFileItem(fileName); _selectedItem.BackupFileName = backupfile; _selectedItem.Series = session.Series; // _selectedItem.Transformed = tempitem.Transformed; _selectedItem.AddTemplates(eventArgs.CameraDevice, session); ServiceProvider.Database.Add(new DbFile(_selectedItem, eventArgs.CameraDevice.SerialNumber, eventArgs.CameraDevice.DisplayName, session.Name)); } catch (Exception ex) { } })); // execute plugins which are executed after transfer ExecuteAutoexportPlugins(eventArgs.CameraDevice, _selectedItem, true); Dispatcher.Invoke(() => { _selectedItem.RemoveThumbs(); session.Add(_selectedItem); ServiceProvider.OnFileTransfered(_selectedItem); }); if (ServiceProvider.Settings.MinimizeToTrayIcon && !IsVisible && !ServiceProvider.Settings.HideTrayNotifications) { MyNotifyIcon.HideBalloonTip(); MyNotifyIcon.ShowBalloonTip("Photo transfered", fileName, BalloonIcon.Info); } ServiceProvider.DeviceManager.LastCapturedImage[eventArgs.CameraDevice] = fileName; //select the new file only when the multiple camera support isn't used to prevent high CPU usage on raw files if (ServiceProvider.Settings.AutoPreview && !ServiceProvider.WindowsManager.Get(typeof(MultipleCameraWnd)).IsVisible&& !ServiceProvider.Settings.UseExternalViewer) { if ((Path.GetExtension(fileName).ToLower() == ".jpg" && ServiceProvider.Settings.AutoPreviewJpgOnly) || !ServiceProvider.Settings.AutoPreviewJpgOnly) { if ((DateTime.Now - _lastLoadTime).TotalSeconds < 4) { _selectiontimer.Stop(); _selectiontimer.Start(); } else { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.Select_Image, _selectedItem); } } } _lastLoadTime = DateTime.Now; //ServiceProvider.Settings.Save(session); StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferDone + " " + strTransfer; if (ServiceProvider.Settings.UseExternalViewer && File.Exists(ServiceProvider.Settings.ExternalViewerPath)) { string arg = ServiceProvider.Settings.ExternalViewerArgs; arg = arg.Contains("%1") ? arg.Replace("%1", fileName) : arg + " " + fileName; PhotoUtils.Run(ServiceProvider.Settings.ExternalViewerPath, arg, ProcessWindowStyle.Normal); } if (ServiceProvider.Settings.PlaySound) { PhotoUtils.PlayCaptureSound(); } eventArgs.CameraDevice.ReleaseResurce(eventArgs.Handle); //show fullscreen only when the multiple camera support isn't used if (ServiceProvider.Settings.Preview && !ServiceProvider.WindowsManager.Get(typeof(MultipleCameraWnd)).IsVisible&& !ServiceProvider.Settings.UseExternalViewer) { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.FullScreenWnd_ShowTimed); } Log.Debug("Photo transfer done."); } catch (Exception ex) { eventArgs.CameraDevice.IsBusy = false; StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferError + " " + ex.Message; Log.Error("Transfer error !", ex); } // not indicated to be used GC.Collect(); //GC.WaitForPendingFinalizers(); }
/// <summary> /// Photoes the captured. /// </summary> /// <param name="o">The o.</param> private void PhotoCaptured(object o) { PhotoCapturedEventArgs eventArgs = o as PhotoCapturedEventArgs; if (eventArgs == null) { return; } try { Log.Debug("Photo transfer begin."); eventArgs.CameraDevice.IsBusy = true; CameraProperty property = eventArgs.CameraDevice.LoadProperties(); PhotoSession session = (PhotoSession)eventArgs.CameraDevice.AttachedPhotoSession ?? ServiceProvider.Settings.DefaultSession; StaticHelper.Instance.SystemMessage = ""; var extension = Path.GetExtension(eventArgs.FileName); if (!eventArgs.CameraDevice.CaptureInSdRam || (extension != null && extension.ToLower() == ".mov")) { if (property.NoDownload) { eventArgs.CameraDevice.IsBusy = false; return; } if (extension != null && (session.DownloadOnlyJpg && extension.ToLower() != ".jpg")) { eventArgs.CameraDevice.IsBusy = false; return; } } StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferBegin; string tempFile = Path.GetTempFileName(); if (File.Exists(tempFile)) { File.Delete(tempFile); } if (!eventArgs.CameraDevice.CaptureInSdRam && session.DownloadThumbOnly) { eventArgs.CameraDevice.TransferFileThumb(eventArgs.Handle, tempFile); } else { eventArgs.CameraDevice.TransferFile(eventArgs.Handle, tempFile); } string fileName = ""; if (!session.UseOriginalFilename || eventArgs.CameraDevice.CaptureInSdRam) { fileName = session.GetNextFileName(eventArgs.FileName, eventArgs.CameraDevice, tempFile); } else { fileName = Path.Combine(session.Folder, eventArgs.FileName); if (File.Exists(fileName) && !session.AllowOverWrite) { fileName = StaticHelper.GetUniqueFilename( Path.GetDirectoryName(fileName) + "\\" + Path.GetFileNameWithoutExtension(fileName) + "_", 0, Path.GetExtension(fileName)); } } if (session.AllowOverWrite && File.Exists(fileName)) { PhotoUtils.WaitForFile(fileName); File.Delete(fileName); } // make lower case extension if (session.LowerCaseExtension && !string.IsNullOrEmpty(Path.GetExtension(fileName))) { fileName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + Path.GetExtension(fileName).ToLower()); } if (session.AskSavePath) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "All files|*.*"; dialog.Title = "Save captured photo"; dialog.FileName = fileName; dialog.InitialDirectory = Path.GetDirectoryName(fileName); if (dialog.ShowDialog() == true) { fileName = dialog.FileName; } else { eventArgs.CameraDevice.IsBusy = false; if (File.Exists(tempFile)) { File.Delete(tempFile); } return; } } if (!Directory.Exists(Path.GetDirectoryName(fileName))) { Directory.CreateDirectory(Path.GetDirectoryName(fileName)); } File.Copy(tempFile, fileName); string backupfile = null; if (session.BackUp) { backupfile = session.CopyBackUp(tempFile, fileName); if (string.IsNullOrEmpty(backupfile)) { StaticHelper.Instance.SystemMessage = "Unable to save the backup"; } } if (!eventArgs.CameraDevice.CaptureInSdRam && session.DeleteFileAfterTransfer) { eventArgs.CameraDevice.DeleteObject(new DeviceObject() { Handle = eventArgs.Handle }); } if (File.Exists(tempFile)) { File.Delete(tempFile); } if (session.WriteComment) { if (!string.IsNullOrEmpty(session.Comment)) { Exiv2Helper.SaveComment(fileName, session.Comment); } if (session.SelectedTag1 != null && !string.IsNullOrEmpty(session.SelectedTag1.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag1.Value); } if (session.SelectedTag2 != null && !string.IsNullOrEmpty(session.SelectedTag2.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag2.Value); } if (session.SelectedTag3 != null && !string.IsNullOrEmpty(session.SelectedTag3.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag3.Value); } if (session.SelectedTag4 != null && !string.IsNullOrEmpty(session.SelectedTag4.Value)) { Exiv2Helper.AddKeyword(fileName, session.SelectedTag4.Value); } } if (session.ExternalData != null) { session.ExternalData.FileName = fileName; } // prevent crash og GUI when item count updated Dispatcher.Invoke(new Action(delegate { try { _selectedItem = session.GetNewFileItem(fileName); _selectedItem.BackupFileName = backupfile; _selectedItem.Series = session.Series; _selectedItem.AddTemplates(eventArgs.CameraDevice, session); ServiceProvider.Database.Add(new DbFile(_selectedItem, eventArgs.CameraDevice.SerialNumber, eventArgs.CameraDevice.DisplayName, session.Name)); } catch (Exception ex) { } })); foreach (AutoExportPluginConfig plugin in ServiceProvider.Settings.DefaultSession.AutoExportPluginConfigs) { if (!plugin.IsEnabled) { continue; } var pl = ServiceProvider.PluginManager.GetAutoExportPlugin(plugin.Type); try { pl.Execute(_selectedItem, plugin); ServiceProvider.Analytics.PluginExecute(plugin.Type); Log.Debug("AutoexportPlugin executed " + plugin.Type); } catch (Exception ex) { plugin.IsError = true; plugin.Error = ex.Message; plugin.IsRedy = true; Log.Error("Error to apply plugin", ex); } } Dispatcher.Invoke(() => { _selectedItem.RemoveThumbs(); session.Add(_selectedItem); ServiceProvider.OnFileTransfered(_selectedItem); }); if (ServiceProvider.Settings.MinimizeToTrayIcon && !IsVisible && !ServiceProvider.Settings.HideTrayNotifications) { MyNotifyIcon.HideBalloonTip(); MyNotifyIcon.ShowBalloonTip("Photo transfered", fileName, BalloonIcon.Info); } ServiceProvider.DeviceManager.LastCapturedImage[eventArgs.CameraDevice] = fileName; //select the new file only when the multiple camera support isn't used to prevent high CPU usage on raw files if (ServiceProvider.Settings.AutoPreview && !ServiceProvider.WindowsManager.Get(typeof(MultipleCameraWnd)).IsVisible&& !ServiceProvider.Settings.UseExternalViewer) { if ((Path.GetExtension(fileName).ToLower() == ".jpg" && ServiceProvider.Settings.AutoPreviewJpgOnly) || !ServiceProvider.Settings.AutoPreviewJpgOnly) { if ((DateTime.Now - _lastLoadTime).TotalSeconds < 4) { _selectiontimer.Stop(); _selectiontimer.Start(); } else { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.Select_Image, _selectedItem); } } } _lastLoadTime = DateTime.Now; //ServiceProvider.Settings.Save(session); StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferDone; eventArgs.CameraDevice.IsBusy = false; //show fullscreen only when the multiple camera support isn't used if (ServiceProvider.Settings.Preview && !ServiceProvider.WindowsManager.Get(typeof(MultipleCameraWnd)).IsVisible&& !ServiceProvider.Settings.UseExternalViewer) { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.FullScreenWnd_ShowTimed); } if (ServiceProvider.Settings.UseExternalViewer && File.Exists(ServiceProvider.Settings.ExternalViewerPath)) { string arg = ServiceProvider.Settings.ExternalViewerArgs; arg = arg.Contains("%1") ? arg.Replace("%1", fileName) : arg + " " + fileName; PhotoUtils.Run(ServiceProvider.Settings.ExternalViewerPath, arg, ProcessWindowStyle.Normal); } if (ServiceProvider.Settings.PlaySound) { PhotoUtils.PlayCaptureSound(); } Log.Debug("Photo transfer done."); } catch (Exception ex) { eventArgs.CameraDevice.IsBusy = false; StaticHelper.Instance.SystemMessage = TranslationStrings.MsgPhotoTransferError + " " + ex.Message; Log.Error("Transfer error !", ex); } // not indicated to be used GC.Collect(); //GC.WaitForPendingFinalizers(); }
void DeviceManager_CameraConnected(ICameraDevice cameraDevice) { MyNotifyIcon.HideBalloonTip(); MyNotifyIcon.ShowBalloonTip("Camera connected", cameraDevice.LoadProperties().DeviceName, BalloonIcon.Info); SortCameras(); }
public void Handle(BalloonMessageModel model) { MyNotifyIcon.ShowBalloonTip(model.Title, model.Message, BalloonIcon.Info); }