<commit_before>﻿#region License
// Copyright (c) Newtonsoft. All Rights Reserved.
// License: https://raw.github.com/JamesNK/Newtonsoft.Json.Schema/master/LICENSE.md
// Modified for use in Manatee.Trello
#endregion

using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Threading;
using Manatee.Json;
using Manatee.Json.Serialization;

namespace Manatee.Trello.Internal.Licensing
{
	internal static class LicenseHelpers
	{
		private class RunDetails
		{
			public long Retrievals { get; set; }
			public long Submissions { get; set; }
			public DateTime SessionExpiry { get; set; }
		}

		public const string BuyMeText = "Please see https://github.com/gregsdennis/Manatee.Trello/wiki/Licensing-3 for information on purchasing a license.";

		private const string DetailsPath = "Manatee.Trello.run";

		private static readonly object Lock;
		private static readonly JsonSerializer Serializer;

		private static long _retrievalCount;
		private static long _submissionCount;
		private static long _sessionExpiry;
		private static LicenseDetails _registeredLicense;
		private static Timer _resetTimer;

		static LicenseHelpers()<commit_msg>write to local app data instead of program folder<commit_after>﻿#region License
// Copyright (c) Newtonsoft. All Rights Reserved.
// License: https://raw.github.com/JamesNK/Newtonsoft.Json.Schema/master/LICENSE.md
// Modified for use in Manatee.Trello
#endregion

using System;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using Manatee.Json;
using Manatee.Json.Serialization;

namespace Manatee.Trello.Internal.Licensing
{
	internal static class LicenseHelpers
	{
		private class RunDetails
		{
			public long Retrievals { get; set; }
			public long Submissions { get; set; }
			public DateTime SessionExpiry { get; set; }
		}

		public const string BuyMeText = "Please see https://github.com/gregsdennis/Manatee.Trello/wiki/Licensing-3 for information on purchasing a license.";

		private const string WindowsDetailsPath = @"%LOCALAPPDATA%\Manatee.Trello\Manatee.Trello.run";
		private const string MacOsDetailsPath = @"~/Library/Manatee.Trello/Manatee.Trello.run";
		private const string UnixDetailsPath = @"~/.config/Manatee.Trello/Manatee.Trello.run";

		private static string DetailsPath
		{
			get
			{
#if NET45
				switch (Environment.OSVersion.Platform)
					{
						case PlatformID.MacOSX:
							return MacOsDetailsPath;
						case PlatformID.Unix:
							return UnixDetailsPath;
						default:
							return Environment.ExpandEnvironmentVariables(WindowsDetailsPath);
					}
#else
				if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
					return MacOsDetailsPath;
				if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
					return UnixDetailsPath;
				return Environment.ExpandEnvironmentVariables(WindowsDetailsPath);
#endif
			}
		}

		private static readonly object Lock;
		private static readonly JsonSerializer Serializer;

		private static long _retrievalCount;
		private static long _submissionCount;
		private static long _sessionExpiry;
		private static LicenseDetails _registeredLicense;
		private static Timer _resetTimer;

		static LicenseHelpers()
{'fraction_non_alphanumeric': 0.08066502463054187, 'fraction_numerical': 0.0012315270935960591, 'mean_word_length': 4.488175675675675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '409749', 'n_tokens_mistral': 1073, 'n_tokens_neox': 931, 'n_words': 259}