示例#1
0
 public GetFileMd5HashAsyncDelegate(
     IStorageController <string> storageController,
     IGetHashAsyncDelegate <string> getStringHashAsyncDelegate)
 {
     this.storageController          = storageController;
     this.getStringHashAsyncDelegate = getStringHashAsyncDelegate;
 }
 public TransactionalStorageController(
     IStorageController <string> storageController,
     IFileController fileController)
 {
     this.storageController = storageController;
     this.fileController    = fileController;
 }
示例#3
0
        /// <summary>
        /// Initialize book's collection and storage for it
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="storage"></param>
        public BookListService(string filePath, IStorageController <Book> storage)
        {
            _logger = LogManager.GetCurrentClassLogger();

            Storage     = storage;
            ListOfBooks = Storage.GetItems() as List <Book> ?? new List <Book>();
        }
示例#4
0
 public PersistenceStrategy(
     IStorageController storageController,
     ILogger logger)
 {
     _storageController = storageController;
     _logger            = logger;
 }
示例#5
0
        public SettingsViewModel(IEditorContext editorContext, IStorageController storageController, ITestRunner testRunner, ITelemetryManager telemetryManager, IOptions options, IIoProvider ioProvider)
        {
            _editorContext     = editorContext;
            _storageController = storageController;
            _testRunner        = testRunner;
            _options           = options;
            _ioProvider        = ioProvider;

            _outputDirectories = new ObservableEnumeration <OutputDirectoryViewModel>(() =>
                                                                                      storageController.GetOutputDirectories().Select(p => new OutputDirectoryViewModel(p)), (a, b) => StringComparer.OrdinalIgnoreCase.Compare(a.Name, b.Name));
            _testSettingsFiles = new ObservableEnumeration <string>(() =>
                                                                    (_editorContext?.Solution.FindFiles(new Regex("^.*\\.runSettings$", RegexOptions.Compiled | RegexOptions.IgnoreCase)) ?? new string[0])
                                                                    .Select(p => _ioProvider.GetRelativePath(p)),
                                                                    StringComparer.OrdinalIgnoreCase.Compare);

            editorContext.BuildFinished  += (o, e) => Refresh();
            editorContext.SolutionOpened += (o, e) => Refresh();

            //Fix unsupported state
            if (_options.IsExcludingTestAssemblies && _options.IsCoveringByTest)
            {
                _options.IsExcludingTestAssemblies = false;
                _options.IsCoveringByTest          = false;
            }
        }
示例#6
0
        public Options(IEditorContext editorContext, IStorageController storageController)
        {
            Settings.Default.SettingChanging += OnSettingChanging;
            _editorContext     = editorContext;
            _storageController = storageController;

            editorContext.SolutionOpened += OnSolutionOpened;
        }
示例#7
0
        public Options(IEditorContext editorContext, IStorageController storageController)
        {
            Settings.Default.SettingChanging += (o, e) => Application.Current.Dispatcher.BeginInvoke(() => OnSettingChanged(e.SettingName));
            _editorContext     = editorContext;
            _storageController = storageController;

            editorContext.SolutionOpened += OnSolutionOpened;
        }
示例#8
0
 public AxoTestRunner(IEditorContext editorContext, IStorageController storageController, IOptions options, ITelemetryManager telemetryManager, ITestAdapterRepository testAdapterRepository)
 {
     _editorContext         = editorContext;
     _storageController     = storageController;
     _options               = options;
     _telemetryManager      = telemetryManager;
     _testAdapterRepository = testAdapterRepository;
 }
示例#9
0
        public UserList(IStorageController controller)
        {
            storageController = controller;

            LoadListFromFile();

            if (userList == null)
            {
                SetDefaultList();
            }
        }
 public SerializedStorageController(
     IStoredHashController storedHashController,
     IStorageController <string> storageController,
     IGetHashAsyncDelegate <string> getStringHashAsyncDelegate,
     ISerializationController <string> serializarionController,
     IStatusController statusController)
 {
     this.storedHashController       = storedHashController;
     this.storageController          = storageController;
     this.getStringHashAsyncDelegate = getStringHashAsyncDelegate;
     this.serializarionController    = serializarionController;
     this.statusController           = statusController;
 }
 public ServiceController(
     IFileHelper fileHelper,
     ITaskHelper taskHelper,
     IFileValidationService fileValidationService,
     IStorageController storageController,
     IReportingController reportingController)
 {
     _fileHelper            = fileHelper;
     _taskHelper            = taskHelper;
     _fileValidationService = fileValidationService;
     _reportingController   = reportingController;
     _storageController     = storageController;
 }
示例#12
0
        public Model(object encryptor, object storageController)
        {
            _password = new ConcretePassword();

            if (encryptor is XOR_EncryptorController)
            {
                _encryptor = encryptor as XOR_EncryptorController;
            }

            if(storageController is FILE_StorageController)
            {
                _storageController = storageController as FILE_StorageController;
            }
        }
 public ServiceController(
     ISourceFileModelBuilder sourceFileModelBuilder,
     ITaskHelper taskHelper,
     IPeriodHelper periodHelper,
     IFileValidationService fileValidationService,
     IStorageController storageController,
     IReportingController reportingController,
     IValidationErrorMessageService validationErrorMessageService,
     IExcelFileService excelFileService)
 {
     _sourceFileModelBuilder        = sourceFileModelBuilder;
     _taskHelper                    = taskHelper;
     _periodHelper                  = periodHelper;
     _fileValidationService         = fileValidationService;
     _reportingController           = reportingController;
     _storageController             = storageController;
     _validationErrorMessageService = validationErrorMessageService;
     _excelFileService              = excelFileService;
 }
示例#14
0
        private void CreateHardDisk(Session vmSession, IStorageController controller, int dev, int port)
        {
            IMedium   rosHdd;
            IProgress progress;

            string curDir = Path.GetFullPath(Environment.CurrentDirectory);

            /* Create the hdd and storage */
            rosHdd   = vBox.CreateHardDisk(null, Path.Combine(curDir, diskFileName));
            progress = rosHdd.CreateBaseStorage(hddSize, new MediumVariant[] { MediumVariant.MediumVariant_Standard });
            progress.WaitForCompletion(-1);

            //String errStr;
            //progress.ErrorInfo.GetDescription(out errStr);
            //Console.WriteLine(errStr);

            /* FIXME: Make sure there is no hdd with the same name hanging around in registered condition */

            /* Attach it to the vm */
            vmSession.Machine.SaveSettings();
            vmSession.Machine.AttachDevice(controller.Name, port, dev, DeviceType.DeviceType_HardDisk, rosHdd);
            vmSession.Machine.SaveSettings();
        }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParseConfigController"/> class.
 /// </summary>
 public AVConfigController(IAVCommandRunner commandRunner, IStorageController storageController)
 {
     this.commandRunner      = commandRunner;
     CurrentConfigController = new AVCurrentConfigController(storageController);
 }
示例#16
0
        private void EmptyHardDisk(Session vmSession)
        {
            IProgress          progress;
            IStorageController controller = null;
            uint    inst;
            IMedium rosHdd = null;
            int     dev = 0, port;
            Boolean HddFound = false;

            /* Go through storage controllers to find IDE/SATA one */
            for (inst = 0; inst < 4; inst++)
            {
                try
                {
                    controller = rosVM.GetStorageControllerByInstance(inst);
                    if (controller.Bus == StorageBus.StorageBus_IDE ||
                        controller.Bus == StorageBus.StorageBus_SATA)
                    {
                        break;
                    }
                }
                catch (Exception exc)
                {
                    /* Just skip it */
                }
            }

            /* Now check what HDD we have connected to this controller */
            for (port = 0; port < controller.MaxPortCount; port++)
            {
                for (dev = 0; dev < controller.MaxDevicesPerPortCount; dev++)
                {
                    try
                    {
                        rosHdd = rosVM.GetMedium(controller.Name, port, dev);
                        if (rosHdd.DeviceType == DeviceType.DeviceType_HardDisk)
                        {
                            /* We found the one and only harddisk */
                            HddFound = true;
                            break;
                        }
                        rosHdd.Close();
                    }
                    catch (Exception exc)
                    {
                        /* Just skip it */
                    }
                }

                if (HddFound)
                {
                    break;
                }
            }

            /* Delete the existing hdd */
            if (HddFound)
            {
                try
                {
                    controller = rosVM.GetStorageControllerByInstance(inst);
                    vmSession.Machine.DetachDevice(controller.Name, port, dev);
                    vmSession.Machine.SaveSettings();

                    progress = rosHdd.DeleteStorage();
                    progress.WaitForCompletion(-1);
                    rosHdd.Close();
                }
                catch (Exception exc)
                {
                    Console.WriteLine("Could not delete existing HDD:" + exc);
                }
            }
            else
            {
                /* Connect to port 0, device 0 if there was no hdd found */
                port = 0;
                dev  = 0;
            }

            /* Create a new one */
            CreateHardDisk(vmSession, controller, port, dev);
        }
 public AVCurrentUserController(IStorageController storageController)
 {
     this.storageController = storageController;
 }
示例#18
0
 public InstallationIdController(IStorageController storageController)
 {
     this.storageController = storageController;
 }
 public InstallationIdController(IStorageController storageController) => StorageController = storageController;
示例#20
0
 public ParseCurrentConfigController(IStorageController storageController)
 {
     StorageController = storageController;
     OperationQueue    = new TaskQueue {
     };
 }
示例#21
0
 /// <summary>
 /// Initialize book's collection and storage for it
 /// </summary>
 /// <param name="filePath"></param>
 /// <param name="storage"></param>
 public BookListService(string filePath, IStorageController <Book> storage)
 {
     Storage     = storage;
     ListOfBooks = Storage.GetItems() as List <Book> ?? new List <Book>();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Parse.Core.Internal.ParseCurrentConfigController"/> class.
        /// </summary>
        public AVCurrentConfigController(IStorageController storageController)
        {
            this.storageController = storageController;

              taskQueue = new TaskQueue();
        }
示例#23
0
 public ParseCurrentUserController(IStorageController storageController) => StorageController = storageController;
示例#24
0
 public UnitListModel(IStorageController storageController)
 {
     _storageController = storageController;
     Models = new List<IUnitModel>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParseConfigController"/> class.
 /// </summary>
 public ParseConfigController(IParseCommandRunner commandRunner, IStorageController storageController)
 {
     this.commandRunner      = commandRunner;
     CurrentConfigController = new ParseCurrentConfigController(storageController);
 }
 public InstallationIdController(IStorageController storageController)
 {
     this.storageController = storageController;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Parse.Core.Internal.ParseCurrentConfigController"/> class.
        /// </summary>
        public ParseCurrentConfigController(IStorageController storageController)
        {
            this.storageController = storageController;

            taskQueue = new TaskQueue();
        }
 public AVCurrentInstallationController(IInstallationIdController installationIdController, IStorageController storageController, IAVInstallationCoder installationCoder)
 {
     this.installationIdController = installationIdController;
       this.storageController = storageController;
       this.installationCoder = installationCoder;
 }
示例#29
0
 public UnitListModel(IStorageController storageController)
 {
     _storageController = storageController;
     Models             = new List <IUnitModel>();
 }
示例#30
0
 public ParseCurrentUserController(IStorageController storageController)
 {
     this.storageController = storageController;
 }
示例#31
0
 public ReportProvider(IStorageController storageController)
 {
     _storageController = storageController;
 }
示例#32
0
 public ParseCurrentInstallationController(IInstallationIdController installationIdController, IStorageController storageController, IParseInstallationCoder installationCoder)
 {
     this.installationIdController = installationIdController;
     this.storageController        = storageController;
     this.installationCoder        = installationCoder;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParseConfigController"/> class.
 /// </summary>
 public ParseConfigController(IParseCommandRunner commandRunner, IStorageController storageController) {
   this.commandRunner = commandRunner;
   CurrentConfigController = new ParseCurrentConfigController(storageController);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParseConfigController"/> class.
 /// </summary>
 public AVConfigController(IAVCommandRunner commandRunner, IStorageController storageController)
 {
     this.commandRunner = commandRunner;
       CurrentConfigController = new AVCurrentConfigController(storageController);
 }
示例#35
0
 /// <summary>
 /// Create a new class instance.
 /// </summary>
 /// <param name="categoryController"><seealso cref="IStorageController{TModel}"/> with categories.</param>
 /// <param name="dataController"><seealso cref="IStorageController{TModel}"/> with data.</param>
 public StorageHandler(IStorageController <CategoryModel> categoryController, IStorageController <DataModel> dataController)
 {
     this.categoryController = categoryController;
     this.dataController     = dataController;
 }