Fix rename errors

This commit is contained in:
Jeremy Wu 2020-04-21 22:16:10 +10:00
parent 3c7f067770
commit f5ed0291a0
17 changed files with 42 additions and 42 deletions

View file

@ -19,7 +19,7 @@ namespace Flow.Launcher.Core.Configuration
/// <returns></returns>
private UpdateManager NewUpdateManager()
{
return new UpdateManager(string.Empty, Constant.Flow.Launcher, Constant.RootDirectory);
return new UpdateManager(string.Empty, Constant.FlowLauncher, Constant.RootDirectory);
}
public void DisablePortableMode()
@ -126,7 +126,7 @@ namespace Flow.Launcher.Core.Configuration
.CreateSubKey("Uninstall", RegistryKeyPermissionCheck.ReadWriteSubTree)) {; }
var key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default)
.CreateSubKey(uninstallRegSubKey + "\\" + Constant.Flow.Launcher, RegistryKeyPermissionCheck.ReadWriteSubTree);
.CreateSubKey(uninstallRegSubKey + "\\" + Constant.FlowLauncher, RegistryKeyPermissionCheck.ReadWriteSubTree);
key.SetValue("DisplayIcon", Constant.ApplicationDirectory + "\\app.ico", RegistryValueKind.String);
using (var portabilityUpdater = NewUpdateManager())

View file

@ -79,7 +79,7 @@ namespace Flow.Launcher.Core.Plugin
{
if (result1.JsonRPCAction.Method.StartsWith("Flow.Launcher."))
{
ExecuteFlow.LauncherAPI(result1.JsonRPCAction.Method.Substring(4), result1.JsonRPCAction.Parameters);
ExecuteFlowLauncherAPI(result1.JsonRPCAction.Method.Substring(4), result1.JsonRPCAction.Parameters);
}
else
{
@ -89,7 +89,7 @@ namespace Flow.Launcher.Core.Plugin
&& !String.IsNullOrEmpty(jsonRpcRequestModel.Method)
&& jsonRpcRequestModel.Method.StartsWith("Flow.Launcher."))
{
ExecuteFlow.LauncherAPI(jsonRpcRequestModel.Method.Substring(4), jsonRpcRequestModel.Parameters);
ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method.Substring(4), jsonRpcRequestModel.Parameters);
}
}
}
@ -105,7 +105,7 @@ namespace Flow.Launcher.Core.Plugin
}
}
private void ExecuteFlow.LauncherAPI(string method, object[] parameters)
private void ExecuteFlowLauncherAPI(string method, object[] parameters)
{
MethodInfo methodInfo = PluginManager.API.GetType().GetMethod(method);
if (methodInfo != null)

View file

@ -27,11 +27,11 @@ namespace Flow.Launcher.Core.Resource
LoadDefaultLanguage();
// we don't want to load /Languages/en.xaml twice
// so add wox language directory after load plugin language files
AddFlow.LauncherLanguageDirectory();
AddFlowLauncherLanguageDirectory();
}
private void AddFlow.LauncherLanguageDirectory()
private void AddFlowLauncherLanguageDirectory()
{
var directory = Path.Combine(Constant.ProgramDirectory, Folder);
_languageDirectories.Add(directory);

View file

@ -6,14 +6,14 @@ namespace Flow.Launcher.Infrastructure
{
public static class Constant
{
public const string Flow.Launcher = "Flow.Launcher";
public const string FlowLauncher = "Flow.Launcher";
public const string Plugins = "Plugins";
public const string ApplicationFileName = Flow.Launcher + ".exe";
public const string ApplicationFileName = FlowLauncher + ".exe";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Flow.Launcher + ".exe");
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, FlowLauncher + ".exe");
public static readonly string ApplicationDirectory = Directory.GetParent(ProgramDirectory).ToString();
public static readonly string RootDirectory = Directory.GetParent(ApplicationDirectory).ToString();

View file

@ -8,9 +8,9 @@ using Flow.Launcher.Infrastructure.UserSettings;
namespace Flow.Launcher.Infrastructure.Storage
{
public class Flow.LauncherJsonStorage<T> : JsonStrorage<T> where T : new()
public class FlowLauncherJsonStorage<T> : JsonStrorage<T> where T : new()
{
public Flow.LauncherJsonStorage()
public FlowLauncherJsonStorage()
{
var directoryPath = Path.Combine(DataLocation.DataDirectory(), DirectoryName);
Helper.ValidateDirectory(directoryPath);

View file

@ -12,7 +12,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public const string PortableFolderName = "UserData";
public const string DeletionIndicatorFile = ".dead";
public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Constant.Flow.Launcher);
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Constant.FlowLauncher);
public static string DataDirectory()
{
if (PortableDataLocationInUse())

View file

@ -76,7 +76,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public bool DontPromptUpdateMsg { get; set; }
public bool EnableUpdateLog { get; set; }
public bool StartFlow.LauncherOnSystemStartup { get; set; } = true;
public bool StartFlowLauncherOnSystemStartup { get; set; } = true;
public bool HideOnStartup { get; set; }
bool _hideNotifyIcon { get; set; }
public bool HideNotifyIcon

View file

@ -3,8 +3,8 @@ using System.Windows.Input;
namespace Flow.Launcher.Plugin
{
public delegate void Flow.LauncherKeyDownEventHandler(Flow.LauncherKeyDownEventArgs e);
public delegate void AfterFlow.LauncherQueryEventHandler(Flow.LauncherQueryEventArgs e);
public delegate void FlowLauncherKeyDownEventHandler(FlowLauncherKeyDownEventArgs e);
public delegate void AfterFlowLauncherQueryEventHandler(FlowLauncherQueryEventArgs e);
public delegate void ResultItemDropEventHandler(Result result, IDataObject dropObject, DragEventArgs e);
@ -15,15 +15,15 @@ namespace Flow.Launcher.Plugin
/// <param name="vkcode"></param>
/// <param name="state"></param>
/// <returns>return true to continue handling, return false to intercept system handling</returns>
public delegate bool Flow.LauncherGlobalKeyboardEventHandler(int keyevent, int vkcode, SpecialKeyState state);
public delegate bool FlowLauncherGlobalKeyboardEventHandler(int keyevent, int vkcode, SpecialKeyState state);
public class Flow.LauncherKeyDownEventArgs
public class FlowLauncherKeyDownEventArgs
{
public string Query { get; set; }
public KeyEventArgs keyEventArgs { get; set; }
}
public class Flow.LauncherQueryEventArgs
public class FlowLauncherQueryEventArgs
{
public Query Query { get; set; }
}

View file

@ -133,6 +133,6 @@ namespace Flow.Launcher.Plugin
/// Fired after global keyboard events
/// if you want to hook something like Ctrl+R, you should use this event
/// </summary>
event Flow.LauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
}
}

View file

@ -73,7 +73,7 @@ namespace Flow.Launcher
Log.Info($"|App.OnStartup|Dependencies Info:{ErrorReporting.DependenciesInfo()}");
Current.MainWindow = window;
Current.MainWindow.Title = Constant.Flow.Launcher;
Current.MainWindow.Title = Constant.FlowLauncher;
// happlebao todo temp fix for instance code logic
// load plugin before change language, because plugin language also needs be changed
@ -98,7 +98,7 @@ namespace Flow.Launcher
private void AutoStartup()
{
if (_settings.StartFlow.LauncherOnSystemStartup)
if (_settings.StartFlowLauncherOnSystemStartup)
{
if (!SettingWindow.StartupSet())
{

View file

@ -107,7 +107,7 @@ namespace Flow.Launcher
{
_notifyIcon = new NotifyIcon
{
Text = Infrastructure.Constant.Flow.Launcher,
Text = Infrastructure.Constant.FlowLauncher,
Icon = Properties.Resources.app,
Visible = !_settings.HideNotifyIcon
};

View file

@ -144,7 +144,7 @@ namespace Flow.Launcher
return PluginManager.AllPlugins.ToList();
}
public event Flow.LauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
[Obsolete("This will be removed in Flow.Launcher 1.3")]
public void PushResults(Query query, PluginMetadata plugin, List<Result> results)

View file

@ -54,7 +54,7 @@ namespace Flow.Launcher
{
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
{
key?.SetValue(Infrastructure.Constant.Flow.Launcher, Infrastructure.Constant.ExecutablePath);
key?.SetValue(Infrastructure.Constant.FlowLauncher, Infrastructure.Constant.ExecutablePath);
}
}
@ -62,7 +62,7 @@ namespace Flow.Launcher
{
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
{
key?.DeleteValue(Infrastructure.Constant.Flow.Launcher, false);
key?.DeleteValue(Infrastructure.Constant.FlowLauncher, false);
}
}
@ -70,7 +70,7 @@ namespace Flow.Launcher
{
using (var key = Registry.CurrentUser.OpenSubKey(StartupPath, true))
{
var path = key?.GetValue(Infrastructure.Constant.Flow.Launcher) as string;
var path = key?.GetValue(Infrastructure.Constant.FlowLauncher) as string;
if (path != null)
{
return path == Infrastructure.Constant.ExecutablePath;

View file

@ -29,9 +29,9 @@ namespace Flow.Launcher.ViewModel
private Query _lastQuery;
private string _queryTextBeforeLeaveResults;
private readonly Flow.LauncherJsonStorage<History> _historyItemsStorage;
private readonly Flow.LauncherJsonStorage<UserSelectedRecord> _userSelectedRecordStorage;
private readonly Flow.LauncherJsonStorage<TopMostRecord> _topMostRecordStorage;
private readonly FlowLauncherJsonStorage<History> _historyItemsStorage;
private readonly FlowLauncherJsonStorage<UserSelectedRecord> _userSelectedRecordStorage;
private readonly FlowLauncherJsonStorage<TopMostRecord> _topMostRecordStorage;
private readonly Settings _settings;
private readonly History _history;
private readonly UserSelectedRecord _userSelectedRecord;
@ -56,9 +56,9 @@ namespace Flow.Launcher.ViewModel
_settings = settings;
_historyItemsStorage = new Flow.LauncherJsonStorage<History>();
_userSelectedRecordStorage = new Flow.LauncherJsonStorage<UserSelectedRecord>();
_topMostRecordStorage = new Flow.LauncherJsonStorage<TopMostRecord>();
_historyItemsStorage = new FlowLauncherJsonStorage<History>();
_userSelectedRecordStorage = new FlowLauncherJsonStorage<UserSelectedRecord>();
_topMostRecordStorage = new FlowLauncherJsonStorage<TopMostRecord>();
_history = _historyItemsStorage.Load();
_userSelectedRecord = _userSelectedRecordStorage.Load();
_topMostRecord = _topMostRecordStorage.Load();
@ -615,12 +615,12 @@ namespace Flow.Launcher.ViewModel
throw new ArgumentException($"wrong LastQueryMode: <{_settings.LastQueryMode}>");
}
ToggleFlow.Launcher();
ToggleFlowLauncher();
e.Handled = true;
}
}
private void ToggleFlow.Launcher()
private void ToggleFlowLauncher()
{
if (MainWindowVisibility != Visibility.Visible)
{

View file

@ -23,13 +23,13 @@ namespace Flow.Launcher.ViewModel
{
private readonly Updater _updater;
private readonly IPortable _portable;
private readonly Flow.LauncherJsonStorage<Settings> _storage;
private readonly FlowLauncherJsonStorage<Settings> _storage;
public SettingWindowViewModel(Updater updater, IPortable portable)
{
_updater = updater;
_portable = portable;
_storage = new Flow.LauncherJsonStorage<Settings>();
_storage = new FlowLauncherJsonStorage<Settings>();
Settings = _storage.Load();
Settings.PropertyChanged += (s, e) =>
{

View file

@ -1,6 +1,6 @@
namespace Flow.Launcher.Plugin.PluginManagement
{
public class Flow.LauncherPluginResult
public class FlowLauncherPluginResult
{
public string plugin_file;
public string description;

View file

@ -123,10 +123,10 @@ namespace Flow.Launcher.Plugin.PluginManagement
Log.Exception("|PluginManagement.ResultForInstallPlugin|Can't connect to Flow.Launcher plugin website, check your conenction", e);
return new List<Result>();
}
List<Flow.LauncherPluginResult> searchedPlugins;
List<FlowLauncherPluginResult> searchedPlugins;
try
{
searchedPlugins = JsonConvert.DeserializeObject<List<Flow.LauncherPluginResult>>(json);
searchedPlugins = JsonConvert.DeserializeObject<List<FlowLauncherPluginResult>>(json);
}
catch (JsonSerializationException e)
{
@ -135,9 +135,9 @@ namespace Flow.Launcher.Plugin.PluginManagement
return results;
}
foreach (Flow.LauncherPluginResult r in searchedPlugins)
foreach (FlowLauncherPluginResult r in searchedPlugins)
{
Flow.LauncherPluginResult r1 = r;
FlowLauncherPluginResult r1 = r;
results.Add(new Result
{
Title = r.name,