private void ReleaseSettings(string projectPath, IThreadHandling threadHandling, IRProjectProperties propertes, bool save)
        {
            _semaphore.Wait();
            try {
                var    access       = _settings[projectPath];
                string settingsFile = null;
                if (string.IsNullOrEmpty(access.Settings.SourceFile))
                {
                    settingsFile = Path.Combine(projectPath, "Settings.R");
                }
                if (save)
                {
                    access.Settings.Save(settingsFile);
                }

                threadHandling?.ExecuteSynchronously(async() => {
                    var currentSettingsFile = await propertes.GetSettingsFileAsync();
                    if (string.IsNullOrEmpty(currentSettingsFile))
                    {
                        settingsFile = settingsFile.MakeRRelativePath(projectPath);
                        await propertes.SetSettingsFileAsync(settingsFile);
                    }
                });
                _settings.Remove(projectPath);
            } finally {
                _semaphore.Release();
            }
        }
예제 #2
0
 public async Task SaveSelectedSettingsFileNameAsync()
 {
     if (_properties != null)
     {
         // Remember R path like ~/... so when project moves we can still find the file
         await _properties.SetSettingsFileAsync(CurrentFile);
     }
 }