示例#1
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();

        CreateDesktopEntry();

        _settings = MainSettings.Instance;
        _settings.PropertyChanged += _settings_PropertyChanged;

        _screenRecorder                  = new GifRecorder();
        _screenRecorder.Completed       += _screenRecorder_Completed;
        _screenRecorder.ScreenshotTaken += _screenRecorder_ScreenshotTaken;
        _screenRecorder.Delay            = TimeSpan.FromMilliseconds(_settings.Recordings.Delay);

        _releasing = true;

        uploadOnStop.Active = _settings.UploadOnStop;

        RadioButton radioBtn = Array.Find(
            new RadioButton[] {
            imgur,
            giphy,
            gfycat
        },
            rBtn => rBtn.Name == _settings.UploadServiceName
            );

        radioBtn.Active = true;

        SetUploader(_settings.UploadServiceName);
    }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RecorderViewModel"/> class.
 /// </summary>
 /// <param name="recorder">
 /// The recorder.
 /// </param>
 /// <param name="settings">
 /// The settings.
 /// </param>
 /// <param name="eventAggregator">
 /// The event aggregator.
 /// </param>
 public RecorderViewModel(
     IScreenRecorder recorder,
     IScreenGunSettings settings,
     IEventAggregator eventAggregator)
 {
     this.recorder        = recorder;
     this.settings        = settings;
     this.eventAggregator = eventAggregator;
     this.UseMicrophone   = this.settings.DefaultMicEnabled;
     this.SetupNotifyIcon();
 }
示例#3
0
 public ScreenRecorderPage()
 {
     InitializeComponent();
     screenRecorder = DependencyService.Get <IScreenRecorder>();
     screenRecorder.PromptDiscard  = true;
     screenRecorder.DiscardMessage = "丢弃删除已经录制视频,预览进一步确认视频内容";
     screenRecorder.DiscardTitle   = "是否保留";
     screenRecorder.RecordStart   += (sender, e) =>
     {
         System.Diagnostics.Debug.WriteLine("!!RecordStart!!");
     };
     screenRecorder.RecordCompleted += (sender, e) =>
     {
         System.Diagnostics.Debug.WriteLine("!!RecordCompleted!!");
     };
 }