From afbce436cd5805395ddaa6eecbb91f7b60842347 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 15 Sep 2020 13:44:22 +1000 Subject: [PATCH] Restore FormBase.WindowTitleStatic semantics without breaking Designer fixes daf6f516c which fixed regression in aa1de1c9d --- src/BizHawk.Client.EmuHawk/FormBase.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/FormBase.cs b/src/BizHawk.Client.EmuHawk/FormBase.cs index d3d67ba35c..20fbffeb7d 100644 --- a/src/BizHawk.Client.EmuHawk/FormBase.cs +++ b/src/BizHawk.Client.EmuHawk/FormBase.cs @@ -21,10 +21,12 @@ namespace BizHawk.Client.EmuHawk set => throw new InvalidOperationException("window title can only be changed by calling " + nameof(UpdateWindowTitle) + " (which calls " + nameof(WindowTitle) + " getter)"); } - protected virtual string WindowTitle => WindowTitleStatic; - + protected virtual string WindowTitle => WindowTitleStatic; + /// To enforce the "static title" semantics for implementations, this getter will be called once and cached. - protected virtual string WindowTitleStatic => GetType().Name; + protected virtual string WindowTitleStatic => DesignMode + ? $"(will take value from WindowTitle/WindowTitleStatic)" + : throw new NotImplementedException("you have to implement this; the Designer prevents this from being an abstract method"); protected override void OnLoad(EventArgs e) {