Microsoft.VisualStudio.R.Package.ProjectSystem.PropertyPages.Settings.SettingsPageControl.SaveSettingsAsync C# (CSharp) Method

SaveSettingsAsync() public method

public SaveSettingsAsync ( ) : Task
return Task
        public async Task<bool> SaveSettingsAsync() {
            bool result = true;
            if (string.IsNullOrEmpty(_viewModel.CurrentFile)) {
                _viewModel.CreateNewSettingsFile();
                PopulateFilesCombo();
            }
            result = await _viewModel.SaveAsync();
            if (result) {
                IsDirty = false;
            }
            return result;
        }

Usage Example

        public async Task DirtyState() {
            var control = new SettingsPageControl(_csp, _appShell, _fs);
            int count = 0;
            control.DirtyStateChanged += (s, e) => {
                count++;
            };
            control.IsDirty = true;
            control.IsDirty.Should().BeTrue();
            count.Should().Be(1);

            await control.SetProjectAsync(_unconfiguredProject, _properties);
            (await control.SaveSettingsAsync()).Should().BeTrue();
            control.IsDirty.Should().BeFalse();
        }
All Usage Examples Of Microsoft.VisualStudio.R.Package.ProjectSystem.PropertyPages.Settings.SettingsPageControl::SaveSettingsAsync