mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 09:49:07 +00:00
remove strong-name signing
This commit is contained in:
@@ -50,10 +50,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
@@ -106,7 +107,6 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
Binary file not shown.
@@ -49,10 +49,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CsvHelper, Version=6.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
|
||||
@@ -91,7 +92,6 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
Binary file not shown.
@@ -53,10 +53,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -109,8 +110,5 @@
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
Binary file not shown.
@@ -51,10 +51,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
@@ -103,8 +104,5 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
Binary file not shown.
@@ -52,10 +52,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="LibAPNG">
|
||||
@@ -103,7 +104,6 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Binary file not shown.
@@ -49,10 +49,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Itenso.Rtf.Converter.Html, Version=1.7.0.0, Culture=neutral, PublicKeyToken=d7f23b760ed5c748, processorArchitecture=MSIL">
|
||||
@@ -99,7 +100,6 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
Binary file not shown.
@@ -50,10 +50,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
@@ -94,7 +95,6 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="Resources\md2html.html" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
Binary file not shown.
@@ -54,10 +54,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="PDFiumSharp, Version=0.1.2.0, Culture=neutral, PublicKeyToken=8828c73f39c04650, processorArchitecture=MSIL">
|
||||
@@ -108,9 +109,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="pdfium_x64.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
Binary file not shown.
@@ -50,10 +50,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
|
||||
@@ -93,7 +94,6 @@
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Binary file not shown.
@@ -53,10 +53,11 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ffme.common">
|
||||
@@ -109,7 +110,6 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<None Include="key.snk" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
Binary file not shown.
@@ -25,7 +25,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using QuickLook.Helpers;
|
||||
using QuickLook.Properties;
|
||||
|
||||
namespace QuickLook
|
||||
{
|
||||
@@ -39,8 +38,8 @@ namespace QuickLook
|
||||
public static readonly bool Is64Bit = Environment.Is64BitProcess;
|
||||
public static readonly bool IsUWP = ProcessHelper.IsRunningAsUWP();
|
||||
public static readonly bool IsWin10 = Environment.OSVersion.Version >= new Version(10, 0);
|
||||
public static readonly string LocalDataPath = Path.GetFullPath(Path.Combine(ConfigurationManager
|
||||
.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath, @"..\..\"));
|
||||
public static readonly string LocalDataPath =
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"pooi.moe\QuickLook\");
|
||||
|
||||
private bool _isFirstInstance;
|
||||
private Mutex _isRunning;
|
||||
@@ -74,7 +73,7 @@ namespace QuickLook
|
||||
RemoteCallShowPreview(e);
|
||||
// second instance: duplicate
|
||||
else
|
||||
MessageBox.Show(TranslationHelper.GetString("APP_SECOND"));
|
||||
MessageBox.Show(TranslationHelper.Get("APP_SECOND"));
|
||||
|
||||
Shutdown();
|
||||
return;
|
||||
@@ -91,24 +90,23 @@ namespace QuickLook
|
||||
|
||||
private void CheckUpdate()
|
||||
{
|
||||
if (DateTime.Now - Settings.Default.LastUpdate < TimeSpan.FromDays(7))
|
||||
if (DateTime.Now - SettingHelper.Get<DateTime>("LastUpdate") < TimeSpan.FromDays(7))
|
||||
return;
|
||||
|
||||
Task.Delay(120 * 1000).ContinueWith(_ => Updater.CheckForUpdates(true));
|
||||
Settings.Default.LastUpdate = DateTime.Now;
|
||||
Settings.Default.Save();
|
||||
SettingHelper.Set("LastUpdate", DateTime.Now);
|
||||
}
|
||||
|
||||
private void UpgradeSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Settings.Default.Upgraded)
|
||||
if (!SettingHelper.Get("Upgraded", true))
|
||||
return;
|
||||
|
||||
Updater.CollectAndShowReleaseNotes();
|
||||
|
||||
Settings.Default.Upgrade();
|
||||
SettingHelper.Set("Upgraded", false);
|
||||
}
|
||||
catch (ConfigurationErrorsException e)
|
||||
{
|
||||
@@ -124,8 +122,7 @@ namespace QuickLook
|
||||
//return;
|
||||
}
|
||||
|
||||
Settings.Default.Upgraded = false;
|
||||
Settings.Default.Save();
|
||||
SettingHelper.Set("Upgraded", false);
|
||||
}
|
||||
|
||||
private void RemoteCallShowPreview(StartupEventArgs e)
|
||||
@@ -137,7 +134,7 @@ namespace QuickLook
|
||||
{
|
||||
TrayIconManager.GetInstance();
|
||||
if (!e.Args.Contains("/autorun") && !IsUWP)
|
||||
TrayIconManager.ShowNotification("", TranslationHelper.GetString("APP_START"));
|
||||
TrayIconManager.ShowNotification("", TranslationHelper.Get("APP_START"));
|
||||
if (e.Args.Contains("/first"))
|
||||
AutoStartupHelper.CreateAutorunShortcut();
|
||||
|
||||
|
113
QuickLook/Helpers/SettingHelper.cs
Normal file
113
QuickLook/Helpers/SettingHelper.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
// Copyright © 2018 Paddy Xu
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml;
|
||||
|
||||
namespace QuickLook.Helpers
|
||||
{
|
||||
internal class SettingHelper
|
||||
{
|
||||
private static readonly Dictionary<string, XmlDocument> FileCache = new Dictionary<string, XmlDocument>();
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static T Get<T>(string id, T failsafe = default(T), Assembly calling = null)
|
||||
{
|
||||
if (!typeof(T).IsSerializable && !typeof(ISerializable).IsAssignableFrom(typeof(T)))
|
||||
throw new InvalidOperationException("A serializable Type is required");
|
||||
|
||||
var file = Path.Combine(App.LocalDataPath,
|
||||
(calling ?? Assembly.GetCallingAssembly()).GetName().Name + ".config");
|
||||
|
||||
var doc = GetConfigFile(file);
|
||||
|
||||
// try to get setting
|
||||
var s = GetSettingFromXml(doc, id, failsafe);
|
||||
|
||||
return s != null ? s : failsafe;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static void Set(string id, object value, Assembly calling = null)
|
||||
{
|
||||
if (!value.GetType().IsSerializable)
|
||||
throw new NotSupportedException("New value if not serializable.");
|
||||
|
||||
var file = Path.Combine(App.LocalDataPath,
|
||||
(calling ?? Assembly.GetCallingAssembly()).GetName().Name + ".config");
|
||||
|
||||
WriteSettingToXml(GetConfigFile(file), id, value);
|
||||
}
|
||||
|
||||
private static T GetSettingFromXml<T>(XmlDocument doc, string id, T failsafe)
|
||||
{
|
||||
var v = doc.SelectSingleNode($@"/Settings/{id}");
|
||||
var result = v == null ? failsafe : (T) Convert.ChangeType(v.InnerText, typeof(T));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static void WriteSettingToXml(XmlDocument doc, string id, object value)
|
||||
{
|
||||
var v = doc.SelectSingleNode($@"/Settings/{id}");
|
||||
|
||||
if (v != null)
|
||||
{
|
||||
v.InnerText = value.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
var node = doc.CreateNode(XmlNodeType.Element, id, doc.NamespaceURI);
|
||||
node.InnerText = value.ToString();
|
||||
doc.SelectSingleNode(@"/Settings").AppendChild(node);
|
||||
}
|
||||
|
||||
doc.Save(new Uri(doc.BaseURI).LocalPath);
|
||||
}
|
||||
|
||||
private static XmlDocument GetConfigFile(string file)
|
||||
{
|
||||
if (FileCache.ContainsKey(file))
|
||||
return FileCache[file];
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(file));
|
||||
if (!File.Exists(file))
|
||||
CreateNewConfig(file);
|
||||
|
||||
var doc = new XmlDocument();
|
||||
doc.Load(file);
|
||||
FileCache.Add(file, doc);
|
||||
return doc;
|
||||
}
|
||||
|
||||
private static void CreateNewConfig(string file)
|
||||
{
|
||||
using (var writer = XmlWriter.Create(file))
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("Settings");
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndDocument();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -30,10 +30,9 @@ namespace QuickLook.Helpers
|
||||
//private static readonly CultureInfo CurrentCultureInfo = CultureInfo.GetCultureInfo("zh-CN");
|
||||
|
||||
private static readonly Dictionary<string, XPathNavigator> FileCache = new Dictionary<string, XPathNavigator>();
|
||||
private static readonly Dictionary<string, string> StringCache = new Dictionary<string, string>();
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static string GetString(string id, string file = null, CultureInfo locale = null, string failsafe = null,
|
||||
public static string Get(string id, string file = null, CultureInfo locale = null, string failsafe = null,
|
||||
Assembly calling = null)
|
||||
{
|
||||
if (file == null)
|
||||
@@ -69,12 +68,7 @@ namespace QuickLook.Helpers
|
||||
|
||||
private static string GetStringFromXml(XPathNavigator nav, string id, CultureInfo locale)
|
||||
{
|
||||
var cacheKey = $"{nav.BaseURI.GetHashCode()}::{locale.Name}::{id}";
|
||||
if (StringCache.ContainsKey(cacheKey))
|
||||
return StringCache[cacheKey];
|
||||
|
||||
var result = nav.SelectSingleNode($@"/Translations/{locale.Name}/{id}");
|
||||
StringCache.Add(cacheKey, result?.Value);
|
||||
|
||||
return result?.Value;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ namespace QuickLook.Helpers
|
||||
if (!silent)
|
||||
Application.Current.Dispatcher.Invoke(
|
||||
() => TrayIconManager.ShowNotification("",
|
||||
TranslationHelper.GetString("Update_NoUpdate")));
|
||||
TranslationHelper.Get("Update_NoUpdate")));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace QuickLook.Helpers
|
||||
() =>
|
||||
{
|
||||
TrayIconManager.ShowNotification("",
|
||||
string.Format(TranslationHelper.GetString("Update_Found"), nVersion),
|
||||
string.Format(TranslationHelper.Get("Update_Found"), nVersion),
|
||||
timeout: 20000,
|
||||
clickEvent:
|
||||
() => Process.Start(
|
||||
@@ -70,7 +70,7 @@ namespace QuickLook.Helpers
|
||||
Debug.WriteLine(e.Message);
|
||||
Application.Current.Dispatcher.Invoke(
|
||||
() => TrayIconManager.ShowNotification("",
|
||||
string.Format(TranslationHelper.GetString("Update_Error"), e.Message)));
|
||||
string.Format(TranslationHelper.Get("Update_Error"), e.Message)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -106,7 +106,7 @@ namespace QuickLook.Helpers
|
||||
Debug.WriteLine(e.Message);
|
||||
Application.Current.Dispatcher.Invoke(
|
||||
() => TrayIconManager.ShowNotification("",
|
||||
string.Format(TranslationHelper.GetString("Update_Error"), e.Message)));
|
||||
string.Format(TranslationHelper.Get("Update_Error"), e.Message)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -198,7 +198,25 @@ namespace QuickLook.Plugin
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public string GetString(string id, string file = null, CultureInfo locale = null, string failsafe = null)
|
||||
{
|
||||
return TranslationHelper.GetString(id, file, locale, failsafe, Assembly.GetCallingAssembly());
|
||||
return TranslationHelper.Get(id, file, locale, failsafe, Assembly.GetCallingAssembly());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a setting from Xml document.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public T GetSetting<T>(string id, T failsafe = default(T))
|
||||
{
|
||||
return SettingHelper.Get(id, failsafe, Assembly.GetCallingAssembly());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a setting from Xml document.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public void SetSetting(string id, object value)
|
||||
{
|
||||
SettingHelper.Set(id, value, Assembly.GetCallingAssembly());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -68,7 +68,7 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
filename.Text = string.IsNullOrEmpty(name) ? path : name;
|
||||
|
||||
var last = File.GetLastWriteTime(path);
|
||||
modDate.Text = string.Format(TranslationHelper.GetString("InfoPanel_LastModified"),
|
||||
modDate.Text = string.Format(TranslationHelper.Get("InfoPanel_LastModified"),
|
||||
last.ToString(CultureInfo.CurrentCulture));
|
||||
|
||||
Stop = false;
|
||||
@@ -91,7 +91,7 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
totalSize.Text =
|
||||
string.Format(TranslationHelper.GetString("InfoPanel_DriveSize"),
|
||||
string.Format(TranslationHelper.Get("InfoPanel_DriveSize"),
|
||||
totalSpace.ToPrettySize(2),
|
||||
totalFreeSpace.ToPrettySize(2));
|
||||
});
|
||||
@@ -107,16 +107,16 @@ namespace QuickLook.Plugin.InfoPanel
|
||||
string t;
|
||||
var folders = totalDirsL == 0
|
||||
? string.Empty
|
||||
: string.Format(TranslationHelper.GetString(
|
||||
: string.Format(TranslationHelper.Get(
|
||||
totalDirsL == 1 ? "InfoPanel_Folder" : "InfoPanel_Folders"), totalDirsL);
|
||||
var files = totalFilesL == 0
|
||||
? string.Empty
|
||||
: string.Format(TranslationHelper.GetString(
|
||||
: string.Format(TranslationHelper.Get(
|
||||
totalFilesL == 1 ? "InfoPanel_File" : "InfoPanel_Files"), totalFilesL);
|
||||
|
||||
if (!string.IsNullOrEmpty(folders) && !string.IsNullOrEmpty(files))
|
||||
t = string.Format(
|
||||
TranslationHelper.GetString("InfoPanel_FolderAndFile"), folders, files);
|
||||
TranslationHelper.Get("InfoPanel_FolderAndFile"), folders, files);
|
||||
else if (string.IsNullOrEmpty(folders) && string.IsNullOrEmpty(files))
|
||||
t = string.Empty;
|
||||
else
|
||||
|
50
QuickLook/Properties/Settings.Designer.cs
generated
50
QuickLook/Properties/Settings.Designer.cs
generated
@@ -1,50 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace QuickLook.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool Upgraded {
|
||||
get {
|
||||
return ((bool)(this["Upgraded"]));
|
||||
}
|
||||
set {
|
||||
this["Upgraded"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("2017-01-01")]
|
||||
public global::System.DateTime LastUpdate {
|
||||
get {
|
||||
return ((global::System.DateTime)(this["LastUpdate"]));
|
||||
}
|
||||
set {
|
||||
this["LastUpdate"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="QuickLook.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Upgraded" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="LastUpdate" Type="System.DateTime" Scope="User">
|
||||
<Value Profile="(Default)">2017-01-01</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
@@ -79,10 +79,11 @@
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
@@ -134,6 +135,7 @@
|
||||
<Compile Include="ExtensionMethods\TypeExtensions.cs" />
|
||||
<Compile Include="Helpers\FileHelper.cs" />
|
||||
<Compile Include="Helpers\ProcessHelper.cs" />
|
||||
<Compile Include="Helpers\SettingHelper.cs" />
|
||||
<Compile Include="Helpers\TranslationHelper.cs" />
|
||||
<Compile Include="PipeServerManager.cs" />
|
||||
<Compile Include="PluginManager.cs" />
|
||||
@@ -207,11 +209,6 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\app_white_16.ico" />
|
||||
<None Include="Resources\app_16.ico" />
|
||||
@@ -231,11 +228,6 @@
|
||||
<Content Include="Fonts\segmdl2.ttf">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="key.snk" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
@@ -30,7 +30,7 @@ namespace QuickLook
|
||||
private readonly NotifyIcon _icon;
|
||||
|
||||
private readonly MenuItem _itemAutorun =
|
||||
new MenuItem(TranslationHelper.GetString("Icon_RunAtStartup"),
|
||||
new MenuItem(TranslationHelper.Get("Icon_RunAtStartup"),
|
||||
(sender, e) =>
|
||||
{
|
||||
if (AutoStartupHelper.IsAutorun())
|
||||
@@ -43,7 +43,7 @@ namespace QuickLook
|
||||
{
|
||||
_icon = new NotifyIcon
|
||||
{
|
||||
Text = string.Format(TranslationHelper.GetString("Icon_ToolTip"),
|
||||
Text = string.Format(TranslationHelper.Get("Icon_ToolTip"),
|
||||
Application.ProductVersion),
|
||||
Icon = GetTrayIconByDPI(),
|
||||
Visible = true,
|
||||
@@ -51,10 +51,10 @@ namespace QuickLook
|
||||
{
|
||||
new MenuItem($"v{Application.ProductVersion}{(App.IsUWP ? " (UWP)" : "")}") {Enabled = false},
|
||||
new MenuItem("-"),
|
||||
new MenuItem(TranslationHelper.GetString("Icon_CheckUpdate"),
|
||||
new MenuItem(TranslationHelper.Get("Icon_CheckUpdate"),
|
||||
(sender, e) => Updater.CheckForUpdates()) {Enabled = !App.IsUWP},
|
||||
_itemAutorun,
|
||||
new MenuItem(TranslationHelper.GetString("Icon_Quit"),
|
||||
new MenuItem(TranslationHelper.Get("Icon_Quit"),
|
||||
(sender, e) => System.Windows.Application.Current.Shutdown())
|
||||
})
|
||||
};
|
||||
|
@@ -243,7 +243,7 @@ namespace QuickLook
|
||||
if (replaceWith.Length > 16)
|
||||
replaceWith = replaceWith.Substring(0, 14) + "…" + replaceWith.Substring(replaceWith.Length - 2);
|
||||
|
||||
str = TranslationHelper.GetString(str);
|
||||
str = TranslationHelper.Get(str);
|
||||
var elements = str.Split(new[] {"{0}"}, StringSplitOptions.None).ToList();
|
||||
while (elements.Count < 2)
|
||||
elements.Add(string.Empty);
|
||||
|
@@ -41,7 +41,7 @@ namespace QuickLook
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
FontFamily = new FontFamily(TranslationHelper.GetString("UI_FontFamily", failsafe: "Segoe UI"));
|
||||
FontFamily = new FontFamily(TranslationHelper.Get("UI_FontFamily", failsafe: "Segoe UI"));
|
||||
|
||||
SizeChanged += SaveWindowSizeOnSizeChanged;
|
||||
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user