mirror of
https://github.com/Maassoft/ColorControl.git
synced 2026-10-21 08:09:49 -05:00
fix potential error, add error dialog
This commit is contained in:
1 parent
da5b7602a2
commit
d00595fb2e
5 files changed
+15
-8
No files matched your search
@@ -27,7 +27,7 @@
|
||||
<ProductName>ColorControl</ProductName>
|
||||
<PublisherName>Maassoft</PublisherName>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.3.0.0</ApplicationVersion>
|
||||
<ApplicationVersion>1.3.1.0</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace ColorControl
|
||||
Devices = task.Result;
|
||||
if (Devices?.Count > 0)
|
||||
{
|
||||
var preferredDevice = Devices.FirstOrDefault(x => x.MacAddress.Equals(Config.PreferredMacAddress)) ?? Devices[0];
|
||||
var preferredDevice = Devices.FirstOrDefault(x => x.MacAddress != null && x.MacAddress.Equals(Config.PreferredMacAddress)) ?? Devices[0];
|
||||
|
||||
SelectedDevice = preferredDevice;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace ColorControl
|
||||
|
||||
if (_lgService != null)
|
||||
{
|
||||
SystemEvents.SessionEnded += new SessionEndedEventHandler(SessionEnded);
|
||||
//SystemEvents.SessionEnded += new SessionEndedEventHandler(SessionEnded);
|
||||
SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(PowerModeChanged);
|
||||
}
|
||||
|
||||
|
||||
+10
-3
@@ -31,9 +31,16 @@ namespace ColorControl
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm(startUpParams));
|
||||
try
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm(startUpParams));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Error while initializing application: " + ex.ToLogString(Environment.StackTrace), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.0.0")]
|
||||
[assembly: AssemblyVersion("1.3.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.1.0")]
|
||||
Reference in new issue
Block a user