Skip to content

Commit

Permalink
Fix UI element base class
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrster committed Apr 7, 2017
1 parent 0955e03 commit 6c23e38
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions ContactPoint.BaseDesign.Wpf/AboutWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
Plugins = core.PluginManager.Plugins.Select(x => new PluginInformationViewModel(x, License));
MachineId = "NOT SUPPORTED"; //string.Join(":", SecurityLicenseProvider.GetMachineId());
MachineId = "-"; //string.Join(":", SecurityLicenseProvider.GetMachineId());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ContactPoint.Plugins.CallTools.OneLine
{
public sealed class OneLinePluginUIElement : PluginCheckedUIElement
public sealed class OneLinePluginUIElement : PluginCheckedUIElementBase
{
private readonly OneLineService _service;

Expand All @@ -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;
}
}
}
8 changes: 4 additions & 4 deletions ContactPoint.Plugins.CallsLog/FormUiElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace ContactPoint.Plugins.CallsLog
{
internal class FormUiElement : PluginCheckedUIElement
internal class FormUiElement : PluginCheckedUIElementBase
{
readonly PluginService _plugin;
CallLogForm _form;
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions ContactPoint/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -129,6 +130,7 @@ static void Main()
}
}

Logger.LogNotice($"ContactPoint IP Phone version: {typeof(Program).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion}");
Logger.LogNotice($"Main Thread Culture is '{Thread.CurrentThread.CurrentCulture}'");
Logger.LogNotice($"UI Thread Culture is '{Thread.CurrentThread.CurrentUICulture}'");

Expand Down

0 comments on commit 6c23e38

Please sign in to comment.