Skip to content

Commit 9a7936f

Browse files
committed
v2.5.1
1 parent 854fae9 commit 9a7936f

File tree

12 files changed

+46
-20
lines changed

12 files changed

+46
-20
lines changed

.vs/QuickLibrary/v16/.suo

2.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.

QuickLibrary/LangMan.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static class LangMan
99

1010
public static string defaultLang = "en";
1111

12-
public static void InitResMan(string nameSpace, string baseName = null)
12+
public static void Init(string nameSpace, string baseName = null)
1313
{
1414
if (baseName == null)
1515
{
@@ -21,9 +21,16 @@ public static void InitResMan(string nameSpace, string baseName = null)
2121
}
2222
}
2323

24-
public static string GetString(string str)
24+
public static string Get(string str)
2525
{
26-
return resMan.GetString(str);
26+
try
27+
{
28+
return resMan.GetString(str);
29+
}
30+
catch
31+
{
32+
return str;
33+
}
2734
}
2835
}
2936
}

QuickLibrary/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.5.0")]
36-
[assembly: AssemblyFileVersion("2.5.0")]
35+
[assembly: AssemblyVersion("2.5.1")]
36+
[assembly: AssemblyFileVersion("2.5.1")]
3737
[assembly: NeutralResourcesLanguage("en")]

QuickLibrary/QlibFixedForm.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public bool UsePadding
157157

158158
#region CONSTRUCTOR
159159

160-
public QlibFixedForm()
160+
public QlibFixedForm()
161161
{
162162
base.FormBorderStyle = FormBorderStyle.None;
163163
base.AutoScaleMode = AutoScaleMode.Dpi;
@@ -183,14 +183,18 @@ public QlibFixedForm()
183183
base.ForeColor = Color.Black;
184184

185185
TextChanged += QlibFixedForm_TextChanged;
186-
187-
SetDarkMode(false, false);
188186
}
189187

190188
#endregion
191189

192190
#region PRIVATE BODY
193191

192+
protected override void OnLoad(EventArgs e)
193+
{
194+
SetDarkMode(DarkMode, AlternativeAppearance);
195+
base.OnLoad(e);
196+
}
197+
194198
protected override void OnHandleCreated(EventArgs e)
195199
{
196200
(new DropShadow()).ApplyShadows(this);
@@ -265,6 +269,11 @@ private void CloseBtn_Click(object sender, EventArgs e)
265269

266270
private void SetDarkMode(bool dark, bool alternative)
267271
{
272+
if (dark)
273+
{
274+
HandleCreated += new EventHandler(ThemeMan.formHandleCreated);
275+
}
276+
268277
darkMode = dark;
269278
alternativeAppearance = alternative;
270279

QuickLibrary/UpdateMan.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public static class UpdateMan
88
private static string _githubOwner;
99
private static string _githubRepo;
1010
private static string _exeName;
11+
private static bool _darkMode;
1112

1213
private static string _title;
1314
private static string _message;
@@ -20,18 +21,16 @@ public static class UpdateMan
2021
private static string _failed;
2122
private static string _install;
2223

23-
private static string _isUpToDate;
24-
25-
public static void Init(string githubOwner, string githubRepo, string exeName)
24+
public static void Init(string githubOwner, string githubRepo, string exeName, bool darkMode)
2625
{
2726
_githubOwner = githubOwner;
2827
_githubRepo = githubRepo;
2928
_exeName = exeName;
29+
_darkMode = darkMode;
3030
}
3131

3232
public static void InitLang(string title, string message, string dwnldBtnText, string whatsNewBtnText,
33-
string updating, string downloading, string readyToInstall, string failed, string install,
34-
string isUpToDate)
33+
string updating, string downloading, string readyToInstall, string failed, string install)
3534
{
3635
_title = title;
3736
_message = message;
@@ -43,11 +42,9 @@ public static void InitLang(string title, string message, string dwnldBtnText, s
4342
_readyToInstall = readyToInstall;
4443
_failed = failed;
4544
_install = install;
46-
47-
_isUpToDate = isUpToDate;
4845
}
4946

50-
public static async void CheckForUpdates(bool showUpToDateDialog, bool topMost, bool darkMode, IntPtr owner)
47+
public static async void CheckForUpdates(bool showUpToDateDialog, bool topMost, IntPtr owner)
5148
{
5249
try
5350
{
@@ -58,18 +55,18 @@ public static async void CheckForUpdates(bool showUpToDateDialog, bool topMost,
5855
{
5956
if (showUpToDateDialog)
6057
{
61-
DialogMan.ShowInfo(_isUpToDate, darkMode: darkMode);
58+
OnIsUpToDate(EventArgs.Empty);
6259
}
6360
}
6461
else
6562
{
66-
UpdateForm updateDialog = new UpdateForm(darkMode, _title, _message, _dwnldBtnText, _whatsNewBtnText);
63+
UpdateForm updateDialog = new UpdateForm(_darkMode, _title, _message, _dwnldBtnText, _whatsNewBtnText);
6764
updateDialog.TopMost = topMost;
6865

6966
DialogResult result = updateDialog.ShowDialog(Form.FromHandle(owner));
7067
if (result == DialogResult.Yes)
7168
{
72-
DownloadForm downloadBox = new DownloadForm(UpdateChecker.GetAssetUrl(_exeName), darkMode, _updating, _downloading, _readyToInstall, _failed, _install);
69+
DownloadForm downloadBox = new DownloadForm(UpdateChecker.GetAssetUrl(_exeName), _darkMode, _updating, _downloading, _readyToInstall, _failed, _install);
7370
downloadBox.TopMost = topMost;
7471
downloadBox.ShowDialog(Form.FromHandle(owner));
7572
}
@@ -83,9 +80,21 @@ public static async void CheckForUpdates(bool showUpToDateDialog, bool topMost,
8380
{
8481
if (showUpToDateDialog)
8582
{
86-
DialogMan.ShowInfo(_failed, darkMode: darkMode);
83+
OnUpdateFailed(EventArgs.Empty);
8784
}
8885
}
8986
}
87+
88+
public static void OnUpdateFailed(EventArgs ea)
89+
{
90+
UpdateFailed?.Invoke(null, ea);
91+
}
92+
public static event EventHandler<EventArgs> UpdateFailed;
93+
94+
public static void OnIsUpToDate(EventArgs ea)
95+
{
96+
IsUpToDate?.Invoke(null, ea);
97+
}
98+
public static event EventHandler<EventArgs> IsUpToDate;
9099
}
91100
}
512 Bytes
Binary file not shown.
2 KB
Binary file not shown.

QuickLibrary/obj/Release/QuickLibrary.csproj.FileListAbsolute.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ D:\Projects\quick-library\QuickLibrary\bin\Release\Utf8Json.dll
3636
D:\Projects\quick-library\QuickLibrary\bin\Release\System.Threading.Tasks.Extensions.xml
3737
D:\Projects\quick-library\QuickLibrary\bin\Release\System.ValueTuple.xml
3838
D:\Projects\quick-library\QuickLibrary\bin\Release\Utf8Json.xml
39+
D:\Projects\quick-library\QuickLibrary\obj\Release\QuickLibrary.csprojAssemblyReference.cache
15.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)