small code refactoring
This commit is contained in:
@@ -1,36 +1,32 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Pilz.Plugins;
|
||||
using System.Configuration;
|
||||
using Z.Reflection.Extensions;
|
||||
using Pilz.Plugins;
|
||||
using System.IO;
|
||||
|
||||
namespace Pilz.Updating.UpdateInstaller
|
||||
namespace Pilz.Updating.UpdateInstaller;
|
||||
|
||||
internal static class General
|
||||
{
|
||||
internal static class General
|
||||
private static string p = null;
|
||||
|
||||
public static string MyAppPath
|
||||
{
|
||||
private static string p = null;
|
||||
|
||||
public static string MyAppPath
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(p))
|
||||
p = Path.GetDirectoryName(IO.Extensions.GetExecutablePath());
|
||||
return p;
|
||||
}
|
||||
if (string.IsNullOrEmpty(p))
|
||||
p = Path.GetDirectoryName(IO.Extensions.GetExecutablePath());
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadAddons(Lib.UpdateInstaller installer)
|
||||
public static void LoadAddons(Lib.UpdateInstaller installer)
|
||||
{
|
||||
var pluginsPath = Path.Combine(MyAppPath, "AddOns");
|
||||
if (Directory.Exists(pluginsPath))
|
||||
{
|
||||
var pluginsPath = Path.Combine(MyAppPath, "AddOns");
|
||||
if (Directory.Exists(pluginsPath))
|
||||
foreach (var subdir in Directory.GetDirectories(pluginsPath, string.Empty, SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
foreach (var subdir in Directory.GetDirectories(pluginsPath, string.Empty, SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
var pluginPath = Path.Combine(subdir, Path.GetFileName(subdir) + ".dll");
|
||||
if (File.Exists(pluginPath))
|
||||
PluginManager.Instance.LoadPlugin(pluginPath, installer);
|
||||
}
|
||||
var pluginPath = Path.Combine(subdir, Path.GetFileName(subdir) + ".dll");
|
||||
if (File.Exists(pluginPath))
|
||||
PluginManager.Instance.LoadPlugin(pluginPath, installer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user