Example #1
0
        public async Task SetProjectAsync(UnconfiguredProject project, IRProjectProperties properties) {
            if(_access != null) {
                throw new InvalidOperationException("Project is already set");
            }
            _access = await _settingsProvider.OpenProjectSettingsAccessAsync(project, properties);
            _viewModel = new SettingsPageViewModel(_access.Settings, _appShell, _fs);
            await _viewModel.SetProjectPathAsync(Path.GetDirectoryName(project.FullPath), properties);

            PopulateFilesCombo();
            LoadPropertyGrid();

            _access.Settings.CollectionChanged += OnSettingsCollectionChanged;
        }
Example #2
0
        public async Task SetProjectAsync(UnconfiguredProject project, IRProjectProperties properties)
        {
            if (_access != null)
            {
                throw new InvalidOperationException("Project is already set");
            }
            _access = await _settingsProvider.OpenProjectSettingsAccessAsync(project, properties);

            _viewModel = new SettingsPageViewModel(_access.Settings, _shell, _fs);
            await _viewModel.SetProjectPathAsync(Path.GetDirectoryName(project.FullPath), properties);

            PopulateFilesCombo();
            LoadPropertyGrid();

            _access.Settings.CollectionChanged += OnSettingsCollectionChanged;
        }
        public ProjectSettingsControlTest(PackageTestFilesFixture files) {
            _files = files;
            _appShell = Substitute.For<IApplicationShell>();
            _fs = Substitute.For<IFileSystem>();

            _access = Substitute.For<IProjectConfigurationSettingsAccess>();
            _access.Settings.Returns(_coll);

            _csp = Substitute.For<IProjectConfigurationSettingsProvider>();
            _csp.OpenProjectSettingsAccessAsync(null, null).ReturnsForAnyArgs(Task.FromResult(_access));

            _unconfiguredProject = Substitute.For<UnconfiguredProject>();
            _unconfiguredProject.FullPath.Returns(@"C:\file.rproj");

            _properties = Substitute.For<IRProjectProperties>();
            _properties.GetSettingsFileAsync().Returns(Task.FromResult<string>(null));
        }
        public ProjectSettingsControlTest(PackageTestFilesFixture files)
        {
            _files = files;
            _shell = Substitute.For <ICoreShell>();
            _fs    = Substitute.For <IFileSystem>();

            _access = Substitute.For <IProjectConfigurationSettingsAccess>();
            _access.Settings.Returns(_coll);

            _csp = Substitute.For <IProjectConfigurationSettingsProvider>();
            _csp.OpenProjectSettingsAccessAsync(null, null).ReturnsForAnyArgs(Task.FromResult(_access));

            _unconfiguredProject = Substitute.For <UnconfiguredProject>();
            _unconfiguredProject.FullPath.Returns(@"C:\file.rproj");

            _properties = Substitute.For <IRProjectProperties>();
            _properties.GetSettingsFileAsync().Returns(Task.FromResult <string>(null));
        }
Example #5
0
 public void Close()
 {
     _access?.Dispose();
     _access = null;
 }
Example #6
0
 public void Close() {
     _access?.Dispose();
     _access = null;
 }