From 6c23e382c3b3328ea44b82657d6e5de6704183b2 Mon Sep 17 00:00:00 2001 From: AY Date: Fri, 7 Apr 2017 17:47:34 +0300 Subject: [PATCH] Fix UI element base class --- ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs | 5 +++-- .../OneLine/OneLinePluginUIElement.cs | 8 ++++---- ContactPoint.Plugins.CallsLog/FormUiElement.cs | 8 ++++---- ContactPoint/Program.cs | 2 ++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs b/ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs index 3a29319..8f20a12 100644 --- a/ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs +++ b/ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using ContactPoint.Common; using ContactPoint.Common.PluginManager; using ContactPoint.Core.Security; @@ -39,9 +40,9 @@ public AboutWindowViewModel(ICore core, SecurityLicenseContent license = null) //} ImageUri = Path.GetFullPath("partner_logo.png"); - Version = core.GetType().Assembly.GetName().Version.ToString(4); + Version = core.GetType().Assembly.GetCustomAttribute()?.InformationalVersion; Plugins = core.PluginManager.Plugins.Select(x => new PluginInformationViewModel(x, License)); - MachineId = "NOT SUPPORTED"; //string.Join(":", SecurityLicenseProvider.GetMachineId()); + MachineId = "-"; //string.Join(":", SecurityLicenseProvider.GetMachineId()); } } diff --git a/ContactPoint.Plugins.CallTools/OneLine/OneLinePluginUIElement.cs b/ContactPoint.Plugins.CallTools/OneLine/OneLinePluginUIElement.cs index a6799d5..4318f28 100644 --- a/ContactPoint.Plugins.CallTools/OneLine/OneLinePluginUIElement.cs +++ b/ContactPoint.Plugins.CallTools/OneLine/OneLinePluginUIElement.cs @@ -6,7 +6,7 @@ namespace ContactPoint.Plugins.CallTools.OneLine { - public sealed class OneLinePluginUIElement : PluginCheckedUIElement + public sealed class OneLinePluginUIElement : PluginCheckedUIElementBase { private readonly OneLineService _service; @@ -27,10 +27,10 @@ public sealed class OneLinePluginUIElement : PluginCheckedUIElement _service.IsOneLine = Checked = Plugin.PluginManager.Core.SettingsManager.GetValueOrSetDefault("OneLinePluginEnabled", true); } - protected override void InternalExecute(object sender) + protected override void ExecuteCheckedCommand(object sender, bool checkedValue, object data) { - _service.IsOneLine = Checked; - Plugin.PluginManager.Core.SettingsManager["OneLinePluginEnabled"] = Checked; + _service.IsOneLine = checkedValue; + Plugin.PluginManager.Core.SettingsManager["OneLinePluginEnabled"] = checkedValue; } } } diff --git a/ContactPoint.Plugins.CallsLog/FormUiElement.cs b/ContactPoint.Plugins.CallsLog/FormUiElement.cs index 7f10a2c..03af4b7 100644 --- a/ContactPoint.Plugins.CallsLog/FormUiElement.cs +++ b/ContactPoint.Plugins.CallsLog/FormUiElement.cs @@ -5,7 +5,7 @@ namespace ContactPoint.Plugins.CallsLog { - internal class FormUiElement : PluginCheckedUIElement + internal class FormUiElement : PluginCheckedUIElementBase { readonly PluginService _plugin; CallLogForm _form; @@ -54,15 +54,15 @@ void Form_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) _form.FormClosed += Form_FormClosed; } - protected override void InternalExecute(object sender) + protected override void ExecuteCheckedCommand(object sender, bool checkedValue, object data) { - if (_plugin.IsStarted && Checked && !_formShown) + if (_plugin.IsStarted && checkedValue && !_formShown) { _form.Show(); _formShown = true; } - if (_plugin.IsStarted && !Checked && _formShown) + if (_plugin.IsStarted && !checkedValue && _formShown) { _form.Close(); } diff --git a/ContactPoint/Program.cs b/ContactPoint/Program.cs index 6dbf517..ffc1b60 100644 --- a/ContactPoint/Program.cs +++ b/ContactPoint/Program.cs @@ -18,6 +18,7 @@ using ContactPoint.BaseDesign.Wpf.CoreDesign; using ExceptionReporting.Core; using System.IO; +using System.Reflection; using System.Runtime.ExceptionServices; using System.Windows.Forms.VisualStyles; using ContactPoint.Commands; @@ -129,6 +130,7 @@ static void Main() } } + Logger.LogNotice($"ContactPoint IP Phone version: {typeof(Program).Assembly.GetCustomAttribute()?.InformationalVersion}"); Logger.LogNotice($"Main Thread Culture is '{Thread.CurrentThread.CurrentCulture}'"); Logger.LogNotice($"UI Thread Culture is '{Thread.CurrentThread.CurrentUICulture}'");