private void InitialiseFields()
        {
            m_snapshot_settings = SettingsManager.Instance.GetSnapshotSettings();
            m_image_settings = SettingsManager.Instance.GetImageSettings();
            m_export_settings = SettingsManager.Instance.GetExportSettings();
            m_hotkey_settings = MainWindow.m_hotkey_manager;

            //general settings
            txtDirectory.Text = m_snapshot_settings.GetParentDirectory();
            txtFrequency.Text = m_snapshot_settings.GetFrequency().TotalSeconds.ToString();
            txtTemplateDirectory.Text = m_export_settings.GetTemplatePath();
            txtSizeLimit.Text = m_snapshot_settings.GetSizeLimit().ToString();
            cbIdleDetection.IsChecked = m_snapshot_settings.IsIdleDetectionEnabled();
            cbSizeLimit.IsChecked = m_snapshot_settings.IsSpaceLimitEnabled();

            if (m_image_settings.GetPixelFormat() == PixelFormat.Format24bppRgb)
                comboPixelFormat.SelectedIndex = 0;
            else if (m_image_settings.GetPixelFormat() == PixelFormat.Format32bppArgb)
                comboPixelFormat.SelectedIndex = 1;
            else if (m_image_settings.GetPixelFormat() == PixelFormat.Format64bppArgb)
                comboPixelFormat.SelectedIndex = 2;

            comboImageFormat.SelectedIndex = Equals(m_image_settings.GetImageFormat(), ImageFormat.Png) ? 0 : 1;

            //shortcut settings
            InitialiseShortcuts();
        }
예제 #2
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            try
            {
                m_hotkey_manager = new HotkeyManager(this);
                LoadHotkeys();

                string startString = String.Format("Start   ({0})", m_hotkey_manager.start_hotkey.ToString());
                string stopString = String.Format("Stop   ({0})", m_hotkey_manager.stop_hotkey.ToString());
                string pauseString = String.Format("Pause   ({0})", m_hotkey_manager.pause_hotkey.ToString());

                contextPlay.Header = startString;
                contextStop.Header = stopString;
                contextPause.Header = pauseString;
            }
            catch
            {
            }
        }