/// <summary>
        /// Saves the settings.
        /// </summary>
        /// <param name="filePath">
        /// The file path.
        /// </param>
        /// <param name="settings">
        /// The settings.
        /// </param>
        public static void SaveSettings(string filePath, IScreenGunSettings settings)
        {
            var settingsFile    = FromSettings(settings);
            var serializeObject = JsonConvert.SerializeObject(settingsFile);

            File.WriteAllText(filePath, serializeObject);
        }
 /// <summary>
 /// Creates a settings file from the given settings.
 /// </summary>
 /// <param name="settings">
 /// The settings view model.
 /// </param>
 /// <returns>
 /// The settings file.
 /// </returns>
 public static SettingsFile FromSettings(IScreenGunSettings settings)
 {
     return(new SettingsFile
     {
         DefaultMicEnabled = settings.DefaultMicEnabled,
         StoragePath = settings.StoragePath,
         RecordingDeviceNumber = settings.RecordingDeviceNumber
     });
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
 /// </summary>
 /// <param name="windowManager">
 /// The window Manager.
 /// </param>
 /// <param name="settings">
 /// The settings.
 /// </param>
 /// <param name="eventAggregator">
 /// The event Aggregator.
 /// </param>
 public ShellViewModel(
     IWindowManager windowManager,
     IScreenGunSettings settings,
     IEventAggregator eventAggregator)
 {
     this.windowManager = windowManager;
     this.settings      = settings;
     this.Files         = new BindableCollection <ScreenGunFileViewModel>();
     this.SearchForFiles();
     eventAggregator.Subscribe(this);
 }
Exemple #4
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();
 }