Add activate statistics

This commit is contained in:
qianlifeng
2015-01-23 21:52:46 +08:00
parent 42d86fab8e
commit 4379145231
15 changed files with 83 additions and 56 deletions

View File

@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using Wox.Infrastructure.Storage;
using Wox.Plugin;
using System.Drawing;
using System.Reflection;
namespace Wox.Core.UserSettings
{
@@ -14,6 +15,10 @@ namespace Wox.Core.UserSettings
[JsonProperty]
public bool DontPromptUpdateMsg { get; set; }
[JsonProperty]
public int ActivateTimes { get; set; }
[JsonProperty]
public bool EnableUpdateLog { get; set; }
@@ -140,15 +145,7 @@ namespace Wox.Core.UserSettings
protected override string ConfigFolder
{
get
{
string userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
if (userProfilePath == null)
{
throw new ArgumentException("Environment variable USERPROFILE is empty");
}
return Path.Combine(Path.Combine(userProfilePath, ".Wox"), "Config");
}
get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); }
}
protected override string ConfigName
@@ -156,6 +153,15 @@ namespace Wox.Core.UserSettings
get { return "config"; }
}
public void IncreaseActivateTimes()
{
ActivateTimes++;
if (ActivateTimes % 15 == 0)
{
Save();
}
}
protected override UserSettingStorage LoadDefault()
{
DontPromptUpdateMsg = false;