示例#1
0
        private void LoadConfiguration()
        {
            string path = ConfigurationFile.GetPath();

            recordingOptions.Load(path);
            SetToggleRecordingKey(KeyInterop.KeyFromVirtualKey(recordingOptions.toggleRecordingHotkey));
            SetToggleVisibilityKey(KeyInterop.KeyFromVirtualKey(recordingOptions.toggleOverlayHotkey));
            timePeriod.Text     = recordingOptions.recordTime.ToString();
            recordingDelay.Text = recordingOptions.recordDelay.ToString();
            allProcessesRecordingcheckBox.IsChecked = recordingOptions.recordAll;
            injectionOnStartUp.IsChecked            = recordingOptions.injectOnStart;
            recordingDetail.Text = RecordingDetailMethods.GetFromString(recordingOptions.recordDetail).ToString();
            userInterfaceState.OverlayPositionProperty = OverlayPositionMethods.GetFromInt(recordingOptions.overlayPosition);
        }
示例#2
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);

            foreach (var item in RecordingDetailMethods.AsStringArray())
            {
                recordingDetail.Items.Add(item);
            }

            presentMon     = new PresentMonWrapper();
            overlayTracker = new OverlayTracker();

            IntPtr hwnd = GetHWND();

            enableRecordings = presentMon.Init(hwnd);

            bool enableOverlay = overlayTracker.Init(hwnd);

            if (!enableOverlay)
            {
                SetInjectionMode(InjectionMode.Disabled);
                tabControl.Visibility          = Visibility.Collapsed;
                overlayStateTextBox.Visibility = Visibility.Visible;
            }

            delayTimer = new DelayTimer(UpdateDelayTimer, StartRecordingDelayed);
            toggleRecordingKeyboardHook.HotkeyDownEvent  += new KeyboardHook.KeyboardDownEvent(ToggleRecordingKeyDownEvent);
            toggleVisibilityKeyboardHook.HotkeyDownEvent += new KeyboardHook.KeyboardDownEvent(overlayTracker.ToggleOverlayVisibility);
            LoadConfiguration();

            // set the event listener after loading the configuration to avoid sending the first property change event.
            userInterfaceState.PropertyChanged += OnUserInterfacePropertyChanged;

            HwndSource source = PresentationSource.FromVisual(this) as HwndSource;

            source.AddHook(WndProc);

            if (recordingOptions.injectOnStart)
            {
                StartCapture(InjectionMode.All);
            }
        }
示例#3
0
 private RecordingDetail GetRecordingDetail()
 {
     return(RecordingDetailMethods.GetFromString(recordingDetail.Text));
 }