diff --git a/HeliosPlus.Reporting/HeliosPlus.Reporting.csproj b/HeliosPlus.Reporting/HeliosPlus.Reporting.csproj index a31606c..1510fbe 100644 --- a/HeliosPlus.Reporting/HeliosPlus.Reporting.csproj +++ b/HeliosPlus.Reporting/HeliosPlus.Reporting.csproj @@ -26,6 +26,7 @@ DEBUG;TRACE prompt 4 + true AnyCPU diff --git a/HeliosPlus.Shared/HeliosPlus.Shared.csproj b/HeliosPlus.Shared/HeliosPlus.Shared.csproj index d0d2acf..972e46c 100644 --- a/HeliosPlus.Shared/HeliosPlus.Shared.csproj +++ b/HeliosPlus.Shared/HeliosPlus.Shared.csproj @@ -22,6 +22,7 @@ prompt 4 Auto + true pdbonly diff --git a/HeliosPlus.Shared/ProfileItem.cs b/HeliosPlus.Shared/ProfileItem.cs index 7b339fa..e817935 100644 --- a/HeliosPlus.Shared/ProfileItem.cs +++ b/HeliosPlus.Shared/ProfileItem.cs @@ -102,7 +102,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ShortcutItem/Instansiation exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutItem/Instansiation exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored }*/ diff --git a/HeliosPlus.Shared/ProfileRepository.cs b/HeliosPlus.Shared/ProfileRepository.cs index 847886b..26716ca 100644 --- a/HeliosPlus.Shared/ProfileRepository.cs +++ b/HeliosPlus.Shared/ProfileRepository.cs @@ -58,7 +58,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ShortcutItem/Instansiation exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutItem/Instansiation exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } @@ -171,7 +171,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/RemoveProfile exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/RemoveProfile exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO check and report } } @@ -206,7 +206,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/RemoveProfile exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/RemoveProfile exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO check and report } } @@ -241,7 +241,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/RemoveProfile exception 3: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/RemoveProfile exception 3: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO check and report } } @@ -426,7 +426,7 @@ namespace HeliosPlus.Shared catch (Exception ex) { // ignored - Console.WriteLine($"ProfileRepository/LoadProfiles exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/LoadProfiles exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine($"Unable to load Profiles from JSON file {_profileStorageJsonFileName}: " + ex.Message); } @@ -481,7 +481,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/SaveProfiles exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/SaveProfiles exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine($"Unable to create Profile folder {_profileStorageJsonPath}: " + ex.Message); } @@ -506,7 +506,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/SaveProfiles exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/SaveProfiles exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine($"Unable to save Profile JSON file {_profileStorageJsonFileName}: " + ex.Message); } @@ -527,7 +527,7 @@ namespace HeliosPlus.Shared } catch (Exception ex) { - Console.WriteLine($"ProfileRepository/SaveProfileIconToCache exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileRepository/SaveProfileIconToCache exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we fail to create an icon based on the Profile, then we use the standard HeliosPlus profile one. // Which is created on program startup. File.Copy(AppHeliosPlusIconFilename, profile.SavedProfileIconCacheFilename); diff --git a/HeliosPlus.ShellExtension/HeliosPlus.ShellExtension.csproj b/HeliosPlus.ShellExtension/HeliosPlus.ShellExtension.csproj index c697fae..3831b78 100644 --- a/HeliosPlus.ShellExtension/HeliosPlus.ShellExtension.csproj +++ b/HeliosPlus.ShellExtension/HeliosPlus.ShellExtension.csproj @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 4 + true pdbonly diff --git a/HeliosPlus/GameLibraries/SteamGame.cs b/HeliosPlus/GameLibraries/SteamGame.cs index ffe5d1a..2cc00b8 100644 --- a/HeliosPlus/GameLibraries/SteamGame.cs +++ b/HeliosPlus/GameLibraries/SteamGame.cs @@ -103,7 +103,7 @@ namespace HeliosPlus.GameLibraries } catch (SecurityException ex) { - Console.WriteLine($"SteamGame/IsRunning securityexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsRunning securityexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("SecurityException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -112,7 +112,7 @@ namespace HeliosPlus.GameLibraries { // Extract some information from this exception, and then // throw it to the parent method. - Console.WriteLine($"SteamGame/IsRunning ioexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsRunning ioexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("IOException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -138,7 +138,7 @@ namespace HeliosPlus.GameLibraries } catch (SecurityException ex) { - Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("SecurityException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -147,7 +147,7 @@ namespace HeliosPlus.GameLibraries { // Extract some information from this exception, and then // throw it to the parent method. - Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("IOException source: {0} - Message: {1}", ex.Source, ex.Message); throw; diff --git a/HeliosPlus/GameLibraries/SteamLibrary.cs b/HeliosPlus/GameLibraries/SteamLibrary.cs index 7cba638..8930ad8 100644 --- a/HeliosPlus/GameLibraries/SteamLibrary.cs +++ b/HeliosPlus/GameLibraries/SteamLibrary.cs @@ -435,7 +435,7 @@ namespace HeliosPlus.GameLibraries } catch (ArgumentException ex) { - Console.WriteLine($"SteamGame/GetAllInstalledGames exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/GetAllInstalledGames exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); //we just want to ignore it if we try to add it twice.... } @@ -558,28 +558,28 @@ namespace HeliosPlus.GameLibraries } catch (SecurityException ex) { - Console.WriteLine($"SteamGame/GetAllInstalledGames securityexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/GetAllInstalledGames securityexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("SecurityException source: {0} - Message: {1}", ex.Source, ex.Message); throw; } catch (UnauthorizedAccessException ex) { - Console.WriteLine($"SteamGame/GetAllInstalledGames unauthorizedaccessexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/GetAllInstalledGames unauthorizedaccessexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("UnauthorizedAccessException source: {0} - Message: {1}", ex.Source, ex.Message); throw; } catch (ObjectDisposedException ex) { - Console.WriteLine($"SteamGame/GetAllInstalledGames objectdisposedexceptions: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/GetAllInstalledGames objectdisposedexceptions: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("ObjectDisposedException source: {0} - Message: {1}", ex.Source, ex.Message); throw; } catch (IOException ex) { - Console.WriteLine($"SteamGame/GetAllInstalledGames ioexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/GetAllInstalledGames ioexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // Extract some information from this exception, and then // throw it to the parent method. if (ex.Source != null) diff --git a/HeliosPlus/GameLibraries/UplayGame.cs b/HeliosPlus/GameLibraries/UplayGame.cs index 757964f..2d3111d 100644 --- a/HeliosPlus/GameLibraries/UplayGame.cs +++ b/HeliosPlus/GameLibraries/UplayGame.cs @@ -104,7 +104,7 @@ namespace HeliosPlus.GameLibraries } catch (SecurityException ex) { - Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("SecurityException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -113,7 +113,7 @@ namespace HeliosPlus.GameLibraries { // Extract some information from this exception, and then // throw it to the parent method. - Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("IOException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -139,7 +139,7 @@ namespace HeliosPlus.GameLibraries } catch (SecurityException ex) { - Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating securityexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("SecurityException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -148,7 +148,7 @@ namespace HeliosPlus.GameLibraries { // Extract some information from this exception, and then // throw it to the parent method. - Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"SteamGame/IsUpdating ioexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); if (ex.Source != null) Console.WriteLine("IOException source: {0} - Message: {1}", ex.Source, ex.Message); throw; @@ -325,7 +325,7 @@ namespace HeliosPlus.GameLibraries } catch (ArgumentException ex) { - Console.WriteLine($"UplayGame/GetAllInstalledGames argumentexception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"UplayGame/GetAllInstalledGames argumentexception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); //we just want to ignore it if we try to add it twice.... } diff --git a/HeliosPlus/HeliosPlus.csproj b/HeliosPlus/HeliosPlus.csproj index 3bfc52c..5de8d64 100644 --- a/HeliosPlus/HeliosPlus.csproj +++ b/HeliosPlus/HeliosPlus.csproj @@ -39,6 +39,7 @@ prompt 4 false + true AnyCPU diff --git a/HeliosPlus/InterProcess/IPCClient.cs b/HeliosPlus/InterProcess/IPCClient.cs index 315758a..5ceb328 100644 --- a/HeliosPlus/InterProcess/IPCClient.cs +++ b/HeliosPlus/InterProcess/IPCClient.cs @@ -52,7 +52,7 @@ namespace HeliosPlus.InterProcess } catch (Exception ex) { - Console.WriteLine($"IPCClient/QueryAll exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"IPCClient/QueryAll exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } @@ -82,7 +82,7 @@ namespace HeliosPlus.InterProcess } catch (Exception ex) { - Console.WriteLine($"IPCClient/QueryByStatus exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"IPCClient/QueryByStatus exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } } diff --git a/HeliosPlus/InterProcess/IPCService.cs b/HeliosPlus/InterProcess/IPCService.cs index 573dacb..0b7c9e9 100644 --- a/HeliosPlus/InterProcess/IPCService.cs +++ b/HeliosPlus/InterProcess/IPCService.cs @@ -53,7 +53,7 @@ namespace HeliosPlus.InterProcess } catch (Exception ex) { - Console.WriteLine($"IPCService/StartService exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"IPCService/StartService exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); try { _serviceHost?.Close(); diff --git a/HeliosPlus/Program.cs b/HeliosPlus/Program.cs index 4f8f7b4..b881fb3 100644 --- a/HeliosPlus/Program.cs +++ b/HeliosPlus/Program.cs @@ -138,7 +138,7 @@ namespace HeliosPlus { } catch (CommandParsingException ex) { - Console.WriteLine($"Program/Main commandParsingException: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/Main commandParsingException: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // You'll always want to catch this exception, otherwise it will generate a messy and confusing error for the end user. // the message will usually be something like: // "Unrecognized command or argument ''" @@ -146,7 +146,7 @@ namespace HeliosPlus { } catch (Exception ex) { - Console.WriteLine($"Program/Main exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/Main exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine("Unable to execute application: {0}", ex.Message); } return 0; @@ -179,7 +179,7 @@ namespace HeliosPlus { } catch (Exception ex) { - Console.WriteLine($"Program/StartUpNormally exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/StartUpNormally exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO } } @@ -228,7 +228,7 @@ namespace HeliosPlus { } catch (Exception ex) { - Console.WriteLine($"Program/StartUpNormally exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/StartUpNormally exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO } @@ -238,7 +238,7 @@ namespace HeliosPlus { } catch (Exception ex) { - Console.WriteLine($"Program/StartUpNormally exception 3: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/StartUpNormally exception 3: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); MessageBox.Show( ex.Message, Language.Fatal_Error, diff --git a/HeliosPlus/ShortcutItem.cs b/HeliosPlus/ShortcutItem.cs index e543b05..4979c9e 100644 --- a/HeliosPlus/ShortcutItem.cs +++ b/HeliosPlus/ShortcutItem.cs @@ -339,7 +339,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutItem/ExtractVisataIcon exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutItem/ExtractVisataIcon exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); return null; } return bmpPngExtracted; diff --git a/HeliosPlus/ShortcutRepository.cs b/HeliosPlus/ShortcutRepository.cs index 5b8b958..0a25608 100644 --- a/HeliosPlus/ShortcutRepository.cs +++ b/HeliosPlus/ShortcutRepository.cs @@ -128,7 +128,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/RemoveShortcut exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/RemoveShortcut exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO check and report } @@ -178,7 +178,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/RemoveShortcut exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/RemoveShortcut exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // TODO check and report } @@ -350,7 +350,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/SaveShortcuts exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/SaveShortcuts exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine($"Unable to create Shortcut folder {_shortcutStorageJsonPath}: " + ex.Message); @@ -376,7 +376,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/SaveShortcuts exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/SaveShortcuts exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); Console.WriteLine($"Unable to save Shortcut JSON file {_shortcutStorageJsonFileName}: " + ex.Message); } @@ -434,7 +434,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/SaveShortcutIconToCache exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/SaveShortcutIconToCache exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we fail to create an icon based on the original executable or game // Then we use the standard HeliosPlus profile one. @@ -537,7 +537,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutItem/Run exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutItem/Run exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } @@ -550,7 +550,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutItem/Run exception 2: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutItem/Run exception 2: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } } @@ -624,7 +624,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"Program/SwitchToSteamGame exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"Program/SwitchToSteamGame exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } @@ -752,7 +752,7 @@ namespace HeliosPlus } catch (Exception ex) { - Console.WriteLine($"ShortcutRepository/ApplyTopology exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutRepository/ApplyTopology exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } } diff --git a/HeliosPlus/UIForms/ApplyingChangesForm.cs b/HeliosPlus/UIForms/ApplyingChangesForm.cs index ace98d5..fdb360a 100644 --- a/HeliosPlus/UIForms/ApplyingChangesForm.cs +++ b/HeliosPlus/UIForms/ApplyingChangesForm.cs @@ -190,7 +190,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ApplyingChangesForm/SplashForm_FormClosing exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ApplyingChangesForm/SplashForm_FormClosing exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } }, this), new SafeInvoker(() => @@ -216,7 +216,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ApplyingChangesForm/SplashForm_Shown exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ApplyingChangesForm/SplashForm_Shown exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // ignored } }, this), new SafeInvoker(DoTimeout, this)); diff --git a/HeliosPlus/UIForms/MainForm.resx b/HeliosPlus/UIForms/MainForm.resx index 54d80ed..8d88b71 100644 --- a/HeliosPlus/UIForms/MainForm.resx +++ b/HeliosPlus/UIForms/MainForm.resx @@ -10768,7 +10768,7 @@ Microsoft Sans Serif, 21.75pt - 212, 182 + 212, 184 360, 50 @@ -10798,7 +10798,7 @@ Flat - 697, 354 + 698, 347 75, 23 diff --git a/HeliosPlus/UIForms/ProfileAdaptor.cs b/HeliosPlus/UIForms/ProfileAdaptor.cs index c1df494..f7b2321 100644 --- a/HeliosPlus/UIForms/ProfileAdaptor.cs +++ b/HeliosPlus/UIForms/ProfileAdaptor.cs @@ -66,7 +66,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ProfileAdaptor/GetThumbnail exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileAdaptor/GetThumbnail exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null return null; @@ -103,7 +103,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ProfileAdaptor/GertUniqueIdentifier exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileAdaptor/GertUniqueIdentifier exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null return null; @@ -127,7 +127,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ProfileAdaptor/GetSourceImage exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileAdaptor/GetSourceImage exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null return null; @@ -158,16 +158,52 @@ namespace HeliosPlus.UIForms // Get file info if (profileToUse.ProfileBitmap is Bitmap) { + // Have to do some gymnastics to get rid of the + // System.Drawing.Image exception created while accessing the Size + bool gotSize = false; + Size mySize = new Size(256, 256); + while (!gotSize) + { + try + { + mySize = profileToUse.ProfileBitmap.Size; + gotSize = true; + } + catch (Exception ex) + { + // catch the System.Drawing.Image exception created while accessing the Size + } + } + + // Have to do some gymnastics to get rid of the + // System.Drawing.Image exception created while accessing the SizeF + bool gotSizeF = false; + SizeF mySizeF = new SizeF(256, 256); + while (!gotSizeF) + { + try + { + mySizeF = profileToUse.ProfileBitmap.PhysicalDimension; + gotSizeF = true; + } + catch (Exception ex) + { + // catch the System.Drawing.Image exception created while accessing the Size + } + } + string name = profileToUse.Name; + string filepath = Path.GetDirectoryName(profileToUse.SavedProfileIconCacheFilename); + string filename = Path.GetFileName(profileToUse.SavedProfileIconCacheFilename); DateTime now = DateTime.Now; details.Add(new Utility.Tuple(ColumnType.DateCreated, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.DateAccessed, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.DateModified, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.FileSize, string.Empty, (long)0)); - details.Add(new Utility.Tuple(ColumnType.FilePath, string.Empty, "")); - details.Add(new Utility.Tuple(ColumnType.FolderName, string.Empty, "")); - details.Add(new Utility.Tuple(ColumnType.Dimensions, string.Empty, new Size(profileToUse.ProfileBitmap.Width, profileToUse.ProfileBitmap.Height))); - details.Add(new Utility.Tuple(ColumnType.Resolution, string.Empty, new SizeF((float)profileToUse.ProfileBitmap.Width, (float)profileToUse.ProfileBitmap.Height))); - details.Add(new Utility.Tuple(ColumnType.ImageDescription, string.Empty, profileToUse.Name)); + details.Add(new Utility.Tuple(ColumnType.FilePath, string.Empty, filepath ?? "")); + details.Add(new Utility.Tuple(ColumnType.FolderName, string.Empty, filepath ?? "")); + details.Add(new Utility.Tuple(ColumnType.Dimensions, string.Empty, mySize)); + details.Add(new Utility.Tuple(ColumnType.Resolution, string.Empty, mySizeF)); + details.Add(new Utility.Tuple(ColumnType.ImageDescription, string.Empty, name ?? "")); details.Add(new Utility.Tuple(ColumnType.EquipmentModel, string.Empty, "")); details.Add(new Utility.Tuple(ColumnType.DateTaken, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.Artist, string.Empty, "")); @@ -185,7 +221,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ProfileAdaptor/Utility.Tuple exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ProfileAdaptor/Utility.Tuple exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null return null; diff --git a/HeliosPlus/UIForms/ShortcutAdaptor.cs b/HeliosPlus/UIForms/ShortcutAdaptor.cs index e33efb5..bc12aa4 100644 --- a/HeliosPlus/UIForms/ShortcutAdaptor.cs +++ b/HeliosPlus/UIForms/ShortcutAdaptor.cs @@ -3,9 +3,8 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; -using System.Linq; +using System.Net; using System.Text; -using System.Threading.Tasks; namespace HeliosPlus.UIForms { @@ -20,7 +19,7 @@ namespace HeliosPlus.UIForms private bool disposed; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public ShortcutAdaptor() { @@ -49,13 +48,14 @@ namespace HeliosPlus.UIForms return null; } - //Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(() => { return false; }); + Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(() => { return false; }); //return shortcut.ShortcutBitmap.GetThumbnailImage(size.Width, size.Height, myCallback, IntPtr.Zero); + //return Manina.Windows.Forms.Instance.GetThumbnail(shortcut.ShortcutBitmap, size, useEmbeddedThumbnails, useExifOrientation); return shortcut.ShortcutBitmap; } catch (Exception ex) { - Console.WriteLine($"ShortcutAdapter/GetThumbnail exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutAdapter/GetThumbnail exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null @@ -83,11 +83,24 @@ namespace HeliosPlus.UIForms try { ShortcutItem shortcut = (ShortcutItem) key; - return shortcut.Name; + //return shortcut.Name; + + + StringBuilder sb = new StringBuilder(); + sb.Append(shortcut.ToString());// Filename + sb.Append(':'); + sb.Append(size.Width); // Thumbnail size + sb.Append(','); + sb.Append(size.Height); + sb.Append(':'); + sb.Append(useEmbeddedThumbnails); + sb.Append(':'); + sb.Append(useExifOrientation); + return sb.ToString(); } catch (Exception ex) { - Console.WriteLine($"ShortcutAdapter/GetUniqueIdentifier exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutAdapter/GetUniqueIdentifier exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a Shortcut // Then we return null return null; @@ -111,7 +124,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ShortcutAdaptor/GetSourceImage exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutAdaptor/GetSourceImage exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null @@ -138,16 +151,53 @@ namespace HeliosPlus.UIForms // Get file info if (shortcut.ShortcutBitmap is Bitmap) { + // Have to do some gymnastics to get rid of the + // System.Drawing.Image exception created while accessing the Size + bool gotSize = false; + Size mySize = new Size(256,256); + while (!gotSize) + { + try + { + mySize = shortcut.ShortcutBitmap.Size; + gotSize = true; + } + catch (Exception ex) + { + // catch the System.Drawing.Image exception created while accessing the Size + } + } + + // Have to do some gymnastics to get rid of the + // System.Drawing.Image exception created while accessing the SizeF + bool gotSizeF = false; + SizeF mySizeF = new SizeF(256, 256); + while (!gotSizeF) + { + try + { + mySizeF = shortcut.ShortcutBitmap.PhysicalDimension; + gotSizeF = true; + } + catch (Exception ex) + { + // catch the System.Drawing.Image exception created while accessing the Size + } + } + + string name = shortcut.Name; + string filepath = Path.GetDirectoryName(shortcut.SavedShortcutIconCacheFilename); + string filename = Path.GetFileName(shortcut.SavedShortcutIconCacheFilename); DateTime now = DateTime.Now; details.Add(new Utility.Tuple(ColumnType.DateCreated, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.DateAccessed, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.DateModified, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.FileSize, string.Empty, (long)0)); - details.Add(new Utility.Tuple(ColumnType.FilePath, string.Empty, shortcut.SavedShortcutIconCacheFilename)); - details.Add(new Utility.Tuple(ColumnType.FolderName, string.Empty, "")); - details.Add(new Utility.Tuple(ColumnType.Dimensions, string.Empty, new Size(shortcut.ShortcutBitmap.Width, shortcut.ShortcutBitmap.Height))); - details.Add(new Utility.Tuple(ColumnType.Resolution, string.Empty, new SizeF((float)shortcut.ShortcutBitmap.Width, (float)shortcut.ShortcutBitmap.Height))); - details.Add(new Utility.Tuple(ColumnType.ImageDescription, string.Empty, shortcut.Name)); + details.Add(new Utility.Tuple(ColumnType.FilePath, string.Empty, filepath ?? "")); + details.Add(new Utility.Tuple(ColumnType.FolderName, string.Empty, filepath ?? "")); + details.Add(new Utility.Tuple(ColumnType.Dimensions, string.Empty, mySize)); + details.Add(new Utility.Tuple(ColumnType.Resolution, string.Empty, mySizeF)); + details.Add(new Utility.Tuple(ColumnType.ImageDescription, string.Empty, name ?? "")); details.Add(new Utility.Tuple(ColumnType.EquipmentModel, string.Empty, "")); details.Add(new Utility.Tuple(ColumnType.DateTaken, string.Empty, now)); details.Add(new Utility.Tuple(ColumnType.Artist, string.Empty, "")); @@ -165,7 +215,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ShortcutAdapter/Utility.Tuple exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutAdapter/Utility.Tuple exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); // If we have a problem with converting the submitted key to a profile // Then we return null return null; diff --git a/HeliosPlus/UIForms/ShortcutForm.cs b/HeliosPlus/UIForms/ShortcutForm.cs index c4c9d8a..fa81776 100644 --- a/HeliosPlus/UIForms/ShortcutForm.cs +++ b/HeliosPlus/UIForms/ShortcutForm.cs @@ -672,7 +672,7 @@ namespace HeliosPlus.UIForms } catch (Exception ex) { - Console.WriteLine($"ShortcutForm exception: {ex.Message}: {ex.InnerException}"); + Console.WriteLine($"ShortcutForm exception: {ex.Message}: {ex.StackTrace} - {ex.InnerException}"); il_games.Images.Add(Image.FromFile("Resources/Steam.ico")); } } else diff --git a/HeliosPlus/UIForms/ShortcutLibraryForm.cs b/HeliosPlus/UIForms/ShortcutLibraryForm.cs index 6f74d08..51976e4 100644 --- a/HeliosPlus/UIForms/ShortcutLibraryForm.cs +++ b/HeliosPlus/UIForms/ShortcutLibraryForm.cs @@ -30,17 +30,10 @@ namespace HeliosPlus.UIForms //_shortcutAdaptor = new ShortcutAdaptor(); //_shortcutRepository = new ShortcutRepository(); //_profileRepository = new ProfileRepository(); - } - - private void btn_new_Click(object sender, EventArgs e) - { - var shortcutForm = new ShortcutForm(); - shortcutForm.ShowDialog(this); - if (shortcutForm.DialogResult == DialogResult.OK) - { - ShortcutRepository.AddShortcut(shortcutForm.Shortcut); - RefreshShortcutLibraryUI(); - } + ilv_saved_shortcuts.MultiSelect = false; + ilv_saved_shortcuts.ThumbnailSize = new Size(100,100); + ilv_saved_shortcuts.AllowDrag = false; + ilv_saved_shortcuts.AllowDrop = false; } private void btn_back_Click(object sender, EventArgs e) @@ -57,48 +50,35 @@ namespace HeliosPlus.UIForms private void RefreshShortcutLibraryUI() { - if (ShortcutRepository.ShortcutCount > 0) + if (ShortcutRepository.ShortcutCount == 0) + return; + + // Temporarily stop updating the saved_profiles listview + ilv_saved_shortcuts.SuspendLayout(); + + ImageListViewItem newItem = null; + ilv_saved_shortcuts.Items.Clear(); + foreach (ShortcutItem loadedShortcut in ShortcutRepository.AllShortcuts) { - // Temporarily stop updating the saved_profiles listview - ilv_saved_shortcuts.SuspendLayout(); + //loadedProfile.SaveProfileImageToCache(); + //newItem = new ImageListViewItem(loadedProfile.SavedProfileCacheFilename, loadedProfile.Name); + //newItem = new ImageListViewItem(loadedProfile, loadedProfile.Name); + newItem = new ImageListViewItem(loadedShortcut, loadedShortcut.Name); - ImageListViewItem newItem = null; - ilv_saved_shortcuts.Items.Clear(); - foreach (ShortcutItem loadedShortcut in ShortcutRepository.AllShortcuts) - { - //loadedProfile.SaveProfileImageToCache(); - //newItem = new ImageListViewItem(loadedProfile.SavedProfileCacheFilename, loadedProfile.Name); - //newItem = new ImageListViewItem(loadedProfile, loadedProfile.Name); - newItem = new ImageListViewItem(loadedShortcut, loadedShortcut.Name); - //ilv_saved_profiles.Items.Add(newItem); - ilv_saved_shortcuts.Items.Add(newItem, _shortcutAdaptor); - } - - if (_selectedShortcut != null && _selectedShortcut is ShortcutItem) - RefreshImageListView(_selectedShortcut); - - // Restart updating the saved_profiles listview - ilv_saved_shortcuts.ResumeLayout(); + // Select it if its the selectedProfile + if (_selectedShortcut is ShortcutItem && _selectedShortcut.Equals(loadedShortcut)) + newItem.Selected = true; + //ilv_saved_profiles.Items.Add(newItem); + ilv_saved_shortcuts.Items.Add(newItem, _shortcutAdaptor); } - // Refresh the image list view - //RefreshImageListView(_selectedShortcut); + + // Restart updating the saved_profiles listview + ilv_saved_shortcuts.ResumeLayout(); + } - private void RefreshImageListView(ShortcutItem shortcut) - { - ilv_saved_shortcuts.ClearSelection(); - IEnumerable matchingImageListViewItems = (from item in ilv_saved_shortcuts.Items where item.Text == shortcut.Name select item); - if (matchingImageListViewItems.Any()) - { - matchingImageListViewItems.First().Selected = true; - matchingImageListViewItems.First().Focused = true; - } - - } - - private ShortcutItem GetShortcutFromName(string shortcutName) { return (from item in ShortcutRepository.AllShortcuts where item.Name == shortcutName select item).First(); @@ -186,6 +166,18 @@ namespace HeliosPlus.UIForms } + private void btn_new_Click(object sender, EventArgs e) + { + var shortcutForm = new ShortcutForm(); + shortcutForm.ShowDialog(this); + if (shortcutForm.DialogResult == DialogResult.OK) + { + ShortcutRepository.AddShortcut(shortcutForm.Shortcut); + _selectedShortcut = shortcutForm.Shortcut; + RefreshShortcutLibraryUI(); + } + } + private void btn_edit_Click(object sender, EventArgs e) { if (_selectedShortcut == null)