From 61448131ed035c40658c5802712083adf7d2b22e Mon Sep 17 00:00:00 2001 From: "Jeffrey T. Fritz" Date: Tue, 19 Feb 2019 21:19:55 -0500 Subject: [PATCH] Fixed Config references to ExecutingAssembly (#128) * Small Powershell Fix (#88) * commented out starting of the stream deck app - this is handled in the Debug -> Application Arguments * Fixed the Fritz.png error * restored the osx post build script and added detailed comments (#90) * Updates to the Powershell script (#98) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Prevent displaying errors in PowerShell script to the user (#93) * bugfix/Silence-non-critical-PowerShell-errors: Prevent displaying errors for operations which can expectedly fail * bugfix/Silence-non-critical-PowerShell-errors: Make the template's .ps1 file match the sample * bugfix/Update-gitignore-with-VSCode-files: Add ignorables for VSCode (#94) * Feature/sample property inspector (#95) * work in progress - sample property inspector * worked through intricacies of the deserialized dynamic payload * Updated Templates * Attempt to fix the template test (#100) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Added a no-restore directive to the testTemplate script * Released (#104) * Release (#101) * Small Powershell Fix (#88) * commented out starting of the stream deck app - this is handled in the Debug -> Application Arguments * Fixed the Fritz.png error * restored the osx post build script and added detailed comments (#90) * Updates to the Powershell script (#98) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Prevent displaying errors in PowerShell script to the user (#93) * bugfix/Silence-non-critical-PowerShell-errors: Prevent displaying errors for operations which can expectedly fail * bugfix/Silence-non-critical-PowerShell-errors: Make the template's .ps1 file match the sample * bugfix/Update-gitignore-with-VSCode-files: Add ignorables for VSCode (#94) * Feature/sample property inspector (#95) * work in progress - sample property inspector * worked through intricacies of the deserialized dynamic payload * Updated Templates * Attempt to fix the template test (#100) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Release with fix to testTemplate (#103) * Small Powershell Fix (#88) * commented out starting of the stream deck app - this is handled in the Debug -> Application Arguments * Fixed the Fritz.png error * restored the osx post build script and added detailed comments (#90) * Updates to the Powershell script (#98) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Prevent displaying errors in PowerShell script to the user (#93) * bugfix/Silence-non-critical-PowerShell-errors: Prevent displaying errors for operations which can expectedly fail * bugfix/Silence-non-critical-PowerShell-errors: Make the template's .ps1 file match the sample * bugfix/Update-gitignore-with-VSCode-files: Add ignorables for VSCode (#94) * Feature/sample property inspector (#95) * work in progress - sample property inspector * worked through intricacies of the deserialized dynamic payload * Updated Templates * Attempt to fix the template test (#100) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Added a no-restore directive to the testTemplate script * extraneous $bindir concatenation causing issues with copying of files - removed that line of code so it copies over properly (#105) * introduced a view model in js to support multiple field property inspectors (#108) * [WIP] Proposal: Refactor Registration Scripts (#110) * migrating registration scripts to a central spot shared by all projects * adding a .gitattributes to prevent cross platform whitespace munging as well as some merge hinting * fix to always pull from current working directory, added logic to pull the csproj file from the working directory as well by file type rather than by name * introduced the most recent powershell changes into this version of the script * this could be a white space issue. * Move plugin logic into action classes (#111) * Add a method to immediately attach a debugger before any functional code has run. * Make changes so that a plugin can support multiple actions Add and throw exceptions for validating actions Convert "MySamplePlugin" to be an action/handler Refactor cancellation token and add ConnectionManager unit tests * Fix build errors from merge misses Mark refactored classes and methods with the "Obsolete" attribute for now. * Update the template to reflect the changes in the SamplePlugin Use the new BaseStreamDeckAction class Update the README with information on creating a new action * Fixed missing method that got dropped during merge * Addressed logger and memory leak issues #73 #114 (#117) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added Default Configuration Builder (#118) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added a default configuration builder #34 Addressed logger and memory leak issues #73 #114 (#117) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added UUID constructor to fix #119 (#121) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added a default configuration builder #34 Addressed logger and memory leak issues #73 #114 (#117) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Fixed some tests, added UUID constructor for #119 * Added a 'RegisterAllActions' feature to the ConnectionManager (#122) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added a default configuration builder #34 Addressed logger and memory leak issues #73 #114 (#117) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Fixed some tests, added UUID constructor for #119 * Added a 'RegisterAllActions' feature to the ConnectionManager * Fixed configuration to use the current executing assembly (#127) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Added a default configuration builder #34 Addressed logger and memory leak issues #73 #114 (#117) * Refactored to an Proxy interface to address #47 * Added remaining EventsSent to ConfigurationManager * Attempting to eliminate memory leak * Adding script to test the Plugin template * WIP * Updated to be more cross-platform friendly * Re-added cheer graffiti * Cleaning up the inner-loop build-debug-process * Addressed logger and memory leak issues #73 #114 * Fixed some tests, added UUID constructor for #119 * Added a 'RegisterAllActions' feature to the ConnectionManager * Updated to properly configure current folder --- src/StreamDeckLib.Config/ConfigurationBuilder.cs | 4 ++-- src/StreamDeckLib/ConnectionManager.cs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/StreamDeckLib.Config/ConfigurationBuilder.cs b/src/StreamDeckLib.Config/ConfigurationBuilder.cs index b81560c..963cdcd 100644 --- a/src/StreamDeckLib.Config/ConfigurationBuilder.cs +++ b/src/StreamDeckLib.Config/ConfigurationBuilder.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Serilog; using System; @@ -39,7 +39,7 @@ private ConfigurationBuilder(string[] args) { public static ConfigurationBuilder BuildDefaultConfiguration(string[] args) { - var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + var dir = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); Directory.SetCurrentDirectory(dir); var configuration = new CONFIG.ConfigurationBuilder() diff --git a/src/StreamDeckLib/ConnectionManager.cs b/src/StreamDeckLib/ConnectionManager.cs index 1fbaa76..de3bf91 100644 --- a/src/StreamDeckLib/ConnectionManager.cs +++ b/src/StreamDeckLib/ConnectionManager.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json; using StreamDeckLib.Messages; using System; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net.WebSockets; @@ -231,6 +232,9 @@ public async Task SetTitleAsync(string context, string newTitle) public async Task SetImageAsync(string context, string imageLocation) { + Debug.WriteLine($"Getting Image from {new FileInfo(imageLocation).FullName} on disk"); + _Logger.LogDebug($"Getting Image from {new FileInfo(imageLocation).FullName} on disk"); + var imgString = Convert.ToBase64String(File.ReadAllBytes(imageLocation), Base64FormattingOptions.None); var args = new SetImageArgs