-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
add80ff
commit d247cc9
Showing
7 changed files
with
42 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.VisualStudio.Extensibility.Settings; | ||
|
||
namespace ICSharpCode.CodeConverter.VsExtension.ICSharpCode.CodeConverter.VsExtension; | ||
|
||
public class ConverterSettingsAccessor | ||
{ | ||
private readonly SettingValues _settings; | ||
|
||
public ConverterSettingsAccessor(SettingValues settings) | ||
{ | ||
_settings = settings ?? throw new ArgumentNullException(nameof(settings)); | ||
} | ||
|
||
public bool CopyResultToClipboardForSingleDocument => GetBooleanSetting(ConverterSettings.CopyResultToClipboardForSingleDocument); | ||
public bool AlwaysOverwriteFiles => GetBooleanSetting(ConverterSettings.AlwaysOverwriteFiles); | ||
public bool CreateBackups => GetBooleanSetting(ConverterSettings.CreateBackups); | ||
public int FormattingTimeout => GetIntegerSetting(ConverterSettings.FormattingTimeout); | ||
|
||
private bool GetBooleanSetting(Setting.Boolean setting) | ||
{ | ||
return _settings.TryGetValue(setting.FullId, out var value) ? value.ValueOrDefault(setting.DefaultValue) : setting.DefaultValue; | ||
} | ||
|
||
private int GetIntegerSetting(Setting.Integer setting) | ||
{ | ||
return _settings.TryGetValue(setting.FullId, out var value) ? value.ValueOrDefault(setting.DefaultValue) : setting.DefaultValue; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters