-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
7 changed files
with
129 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="PdfTool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<userSettings> | ||
<PdfTool.Properties.Settings> | ||
<setting name="ImageConversionMode" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
<setting name="PdfAction" serializeAs="String"> | ||
<value>0</value> | ||
</setting> | ||
</PdfTool.Properties.Settings> | ||
</userSettings> | ||
</configuration> |
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 |
---|---|---|
@@ -1,9 +1,31 @@ | ||
namespace PdfTool.Models; | ||
|
||
internal sealed record AppSettings { | ||
public ImageConversionMode ConversionMode { get; set; } | ||
internal sealed class AppSettings { | ||
private ImageConversionMode _conversionMode; | ||
private PdfAction _action; | ||
|
||
public PdfAction Action { get; set; } | ||
public ImageConversionMode ConversionMode { | ||
get => _conversionMode; | ||
set { | ||
_conversionMode = value; | ||
Properties.Settings.Default[nameof(ImageConversionMode)] = (int)value; | ||
Properties.Settings.Default.Save(); | ||
} | ||
} | ||
|
||
public PdfAction Action { | ||
get => _action; | ||
set { | ||
_action = value; | ||
Properties.Settings.Default[nameof(PdfAction)] = (int)value; | ||
Properties.Settings.Default.Save(); | ||
} | ||
} | ||
|
||
public string MergedFilename { get; set; } = "Merged"; | ||
|
||
public AppSettings() { | ||
_conversionMode = (ImageConversionMode)Properties.Settings.Default[nameof(ImageConversionMode)]; | ||
_action = (PdfAction)Properties.Settings.Default[nameof(PdfAction)]; | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="PdfTool.Properties" GeneratedClassName="Settings"> | ||
<Profiles /> | ||
<Settings> | ||
<Setting Name="ImageConversionMode" Type="System.Int32" Scope="User"> | ||
<Value Profile="(Default)">0</Value> | ||
</Setting> | ||
<Setting Name="PdfAction" Type="System.Int32" Scope="User"> | ||
<Value Profile="(Default)">0</Value> | ||
</Setting> | ||
</Settings> | ||
</SettingsFile> |