From da25052e09e08ac9ef6d08f00bbcc9ac26502533 Mon Sep 17 00:00:00 2001 From: Hathor86 Date: Thu, 24 Dec 2015 14:00:08 +0100 Subject: [PATCH] Just few comments on above notwa's method :) (Oh and transform string concatenation with + to a string.Format) Also made a small fix to externaltoolmanager --- BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs | 5 ++++- BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs | 7 ++++++- BizHawk.Client.Common/tools/Watch/Watch.cs | 7 ++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs index 8b851306db..631d789319 100644 --- a/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs +++ b/BizHawk.Client.ApiHawk/Classes/ExternalToolManager.cs @@ -37,7 +37,10 @@ namespace BizHawk.Client.ApiHawk } directoryMonitor = new FileSystemWatcher(Global.Config.PathEntries["Global", "External Tools"].Path, "*.dll"); directoryMonitor.IncludeSubdirectories = false; - directoryMonitor.Created += DirectoryMonitor_Created; + directoryMonitor.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName; + directoryMonitor.Filter = "*.dll"; + directoryMonitor.Created += new FileSystemEventHandler(DirectoryMonitor_Created); + directoryMonitor.EnableRaisingEvents = true; BuildToolStrip(); } diff --git a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs index dae9193522..a7314c7f4c 100644 --- a/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/SeparatorWatch.cs @@ -74,7 +74,12 @@ namespace BizHawk.Client.Common { get { return string.Empty; } } - + + /// + /// TTransform the current instance into a displayable (short representation) string + /// It's used by the "Display on screen" option in the RamWatch window + /// + /// A well formatted string representation public override string ToDisplayString() { return "----"; diff --git a/BizHawk.Client.Common/tools/Watch/Watch.cs b/BizHawk.Client.Common/tools/Watch/Watch.cs index e6ece27059..affdf673fb 100644 --- a/BizHawk.Client.Common/tools/Watch/Watch.cs +++ b/BizHawk.Client.Common/tools/Watch/Watch.cs @@ -567,9 +567,14 @@ namespace BizHawk.Client.Common ); } + /// + /// Transform the current instance into a displayable (short representation) string + /// It's used by the "Display on screen" option in the RamWatch window + /// + /// A well formatted string representation public virtual string ToDisplayString() { - return Notes + ": " + ValueString; + return string.Format("{0}: {1}", Notes, ValueString); } #endregion