private void Window_Loaded(object sender, RoutedEventArgs e) { try { logger.Info("logging v2"); ActivationManager am = new ActivationManager(); am.PresistActivation(); // am.IsExipred(); logger.Info("get capture instance"); Capture capture = Capture.GetInstance(); logger.Info("set the device to the wpf"); capture.SetCaptureDeviceWPFControl(videoElement); //folder view logger.Info("open the categories"); StonesView.ViewControl = ViewControl; DirectoryManager dm = DirectoryManager.GetInstance(); string path = dm.GetHomeFolder(); FolderBrowser fb = FolderBrowser.GetInstance(); logger.Info("set working folder"); fb.SetFolderControl(this.FolderBrowserTree); fb.AddItemClickEvents(); fb.Init(path); StonesView.StoneInfoDisplayControl = StoneInfo; StonesView.InitStonesView(); logger.Info("Init stone view"); StonesView.LoadImagesToImageView(path); logger.Info("loading images"); if (SettingsManager.ReadBoolSetting("RunFirstTime")) { //TODO add here things to run the first time //Options options = new Options(); //options.Owner = this; //options.Show(); SettingsManager.WriteBoolSetting("RunFirstTime", false); } CaptureMovieProcessFlow flow = CaptureMovieProcessFlow.GetInstance(); flow.TextBlock = this.MovieFlowTimerText; flow.CaptureFacede = capture; } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); throw; } }
private void SaveOptions_Click(object sender, RoutedEventArgs e) { try { if (Directory.Exists(this.txt_repositoryfolder.Text)) { DirectoryManager dm = DirectoryManager.GetInstance(); dm.SaveHomeFolder(this.txt_repositoryfolder.Text); FolderBrowser fb = FolderBrowser.GetInstance(); fb.ChangeHomeFolder(this.txt_repositoryfolder.Text); this.Close(); } else { MessageBox.Show("Invalid path"); } if (File.Exists(txt_imageeditor.Text)) { SettingsManager.UpdateSetting("ImageEditorPath", txt_imageeditor.Text); } else { MessageBox.Show("Invalid editor path"); } //devices int deviceid = this.DeviceCombo.SelectedIndex; Capture capture = Capture.GetInstance(); if (deviceid >= 0) { if (MultimediaUtil.VideoInputDevices[deviceid] != null) { capture.SetCaptureDevice(MultimediaUtil.VideoInputDevices[deviceid]); } } //editor } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); throw; } }
private void CreateSubFolder_Click(object sender, RoutedEventArgs e) { FolderBrowser fb = FolderBrowser.GetInstance(); fb.CreateNewSubFolderUnderCurrentFolder(); }