forked from paulirwin/JavaToCSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurrentOptions.cs
More file actions
36 lines (30 loc) · 1.56 KB
/
Copy pathCurrentOptions.cs
File metadata and controls
36 lines (30 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using JavaToCSharp;
using JavaToCSharpGui.Properties;
namespace JavaToCSharpGui;
public static class CurrentOptions
{
static CurrentOptions()
{
Options.IncludeUsings = Settings.Default.UseUsingsPreference;
Options.IncludeNamespace = Settings.Default.UseNamespacePreference;
Options.IncludeComments = Settings.Default.IncludeComments;
Options.UseDebugAssertForAsserts = Settings.Default.UseDebugAssertPreference;
Options.UseUnrecognizedCodeToComment = Settings.Default.UseUnrecognizedCodeToComment;
Options.ConvertSystemOutToConsole = Settings.Default.ConvertSystemOutToConsole;
Options.UseFileScopedNamespaces = Settings.Default.UseFileScopedNamespaces;
Options.SetUsings(Settings.Default.Usings.Split(';'));
}
public static JavaConversionOptions Options { get; } = new JavaConversionOptions();
public static void Persist()
{
Settings.Default.UseUsingsPreference = Options.IncludeUsings;
Settings.Default.UseNamespacePreference = Options.IncludeNamespace;
Settings.Default.IncludeComments = Options.IncludeComments;
Settings.Default.UseDebugAssertPreference = Options.UseDebugAssertForAsserts;
Settings.Default.UseUnrecognizedCodeToComment = Options.UseUnrecognizedCodeToComment;
Settings.Default.ConvertSystemOutToConsole = Options.ConvertSystemOutToConsole;
Settings.Default.UseFileScopedNamespaces = Options.UseFileScopedNamespaces;
Settings.Default.Usings = string.Join(";", Options.Usings);
Settings.Default.Save();
}
}