mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Globals] Make exe directory a global value
This commit is contained in:
@@ -1,4 +1,11 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Reflection;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
#if MONO
|
||||||
|
using System.IO;
|
||||||
|
#else
|
||||||
|
using Alphaleonis.Win32.Filesystem;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace SabreTools.Helper.Data
|
namespace SabreTools.Helper.Data
|
||||||
{
|
{
|
||||||
@@ -8,6 +15,7 @@ namespace SabreTools.Helper.Data
|
|||||||
|
|
||||||
private static Logger _logger = null;
|
private static Logger _logger = null;
|
||||||
private static int _maxDegreeOfParallelism = 4;
|
private static int _maxDegreeOfParallelism = 4;
|
||||||
|
private static string _exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -39,6 +47,13 @@ namespace SabreTools.Helper.Data
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static string ExeDir
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _exeDir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
using SabreTools.Helper.Data;
|
using SabreTools.Helper.Data;
|
||||||
|
|
||||||
@@ -33,7 +32,7 @@ namespace SabreTools.Helper
|
|||||||
private StreamWriter _log;
|
private StreamWriter _log;
|
||||||
|
|
||||||
// Private required variables
|
// Private required variables
|
||||||
private string _basepath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase), "logs") + Path.DirectorySeparatorChar;
|
private string _basepath = Path.Combine(Globals.ExeDir, "logs") + Path.DirectorySeparatorChar;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initialize a console-only logger object
|
/// Initialize a console-only logger object
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Reflection;
|
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
using SabreTools.Helper.Data;
|
using SabreTools.Helper.Data;
|
||||||
@@ -31,7 +30,7 @@ namespace SabreTools.Helper.Skippers
|
|||||||
public string SourceFile;
|
public string SourceFile;
|
||||||
|
|
||||||
// Local paths
|
// Local paths
|
||||||
public static string LocalPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase), "Skippers") + Path.DirectorySeparatorChar;
|
public static string LocalPath = Path.Combine(Globals.ExeDir, "Skippers") + Path.DirectorySeparatorChar;
|
||||||
|
|
||||||
// Header skippers represented by a list of skipper objects
|
// Header skippers represented by a list of skipper objects
|
||||||
private static List<Skipper> _list;
|
private static List<Skipper> _list;
|
||||||
|
|||||||
Reference in New Issue
Block a user