Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OpenFileForm"/> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="uiService">The UI service.</param>
 /// <param name="progressService">Progress service.</param>
 /// <param name="reader">Nefs reader.</param>
 /// <param name="fileSystem">The file system.</param>
 public OpenFileForm(
     ISettingsService settingsService,
     IUiService uiService,
     IProgressService progressService,
     INefsReader reader,
     IFileSystem fileSystem)
 {
     this.InitializeComponent();
     this.SettingsService = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
     this.UiService       = uiService ?? throw new ArgumentNullException(nameof(uiService));
     this.ProgressService = progressService ?? throw new ArgumentNullException(nameof(progressService));
     this.Reader          = reader ?? throw new ArgumentNullException(nameof(reader));
     this.FileSystem      = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
 }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NefsEditWorkspace"/> class.
        /// </summary>
        /// <param name="fileSystem">The file system to use.</param>
        /// <param name="progressService">The progress service to use.</param>
        /// <param name="uiService">The UI service to use.</param>
        /// <param name="settingsService">The settings service to use.</param>
        /// <param name="nefsReader">The nefs reader to use.</param>
        /// <param name="nefsWriter">The nefs wrtier to use.</param>
        /// <param name="nefsTransformer">The nefs transformer to use.</param>
        public NefsEditWorkspace(
            IFileSystem fileSystem,
            IProgressService progressService,
            IUiService uiService,
            ISettingsService settingsService,
            INefsReader nefsReader,
            INefsWriter nefsWriter,
            INefsTransformer nefsTransformer)
        {
            this.FileSystem      = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
            this.ProgressService = progressService ?? throw new ArgumentNullException(nameof(progressService));
            this.UiService       = uiService ?? throw new ArgumentNullException(nameof(uiService));
            this.SettingsService = settingsService ?? throw new ArgumentNullException(nameof(settingsService));
            this.NefsReader      = nefsReader ?? throw new ArgumentNullException(nameof(nefsReader));
            this.NefsWriter      = nefsWriter ?? throw new ArgumentNullException(nameof(nefsWriter));
            this.NefsTransformer = nefsTransformer ?? throw new ArgumentNullException(nameof(nefsTransformer));

            this.Archive       = null;
            this.ArchiveSource = null;

            this.UndoBuffer = new UndoBuffer();
            this.UndoBuffer.CommandExecuted += (o, e) => this.CommandExecuted?.Invoke(o, e);
        }