コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: gitter-badger/GS
        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;
            }
        }