using System.Collections.Generic;\r
using System.Drawing;\r
using System.IO;\r
-using System.Windows.Forms;\r
using Codeplex.Data;\r
\r
namespace KancolleSniffer\r
\r
public class Config\r
{\r
- private readonly string _baseDir = Path.GetDirectoryName(Application.ExecutablePath);\r
+ private readonly string _baseDir = AppDomain.CurrentDomain.BaseDirectory;\r
private readonly string _configFileName;\r
\r
public Point Location { get; set; }\r
\r
private string StripBaseDir(string path)\r
{\r
- if (_baseDir == null)\r
- return path;\r
if (!path.StartsWith(_baseDir))\r
return path;\r
path = path.Substring(_baseDir.Length);\r
return path.StartsWith(Path.DirectorySeparatorChar.ToString()) ? path.Substring(1) : path;\r
}\r
\r
- private string PrependBaseDir(string path)\r
- {\r
- if (_baseDir == null)\r
- return path;\r
- if (Path.IsPathRooted(path))\r
- return path;\r
- return Path.Combine(_baseDir, path);\r
- }\r
+ private string PrependBaseDir(string path) => Path.IsPathRooted(path) ? path : Path.Combine(_baseDir, path);\r
}\r
}
\ No newline at end of file
using System.Text;\r
using System.Threading;\r
using System.Web;\r
-using System.Windows.Forms;\r
\r
namespace KancolleSniffer\r
{\r
public class LogServer\r
{\r
private readonly TcpListener _listener;\r
- private readonly string _indexDir = Path.GetDirectoryName(Application.ExecutablePath);\r
- private string _outputDir = Path.GetDirectoryName(Application.ExecutablePath);\r
+ private readonly string _indexDir = AppDomain.CurrentDomain.BaseDirectory;\r
+ private string _outputDir = AppDomain.CurrentDomain.BaseDirectory;\r
\r
public int Port { get; private set; }\r
\r
using System;\r
using System.Collections.Generic;\r
using System.IO;\r
-using System.Text;\r
using System.Linq;\r
+using System.Text;\r
using System.Web;\r
-using System.Windows.Forms;\r
\r
namespace KancolleSniffer\r
{\r
\r
public LogWriter(string outputDir = null, IFile file = null)\r
{\r
- _outputDir = outputDir ?? Path.GetDirectoryName(Application.ExecutablePath);\r
+ _outputDir = outputDir ?? AppDomain.CurrentDomain.BaseDirectory;\r
_file = file ?? new FileWrapper();\r
}\r
\r
\r
using System;\r
using System.IO;\r
-using System.Windows.Forms;\r
using Codeplex.Data;\r
\r
namespace KancolleSniffer\r
\r
public class Status\r
{\r
- // ReSharper disable once AssignNullToNotNullAttribute\r
- private readonly string _statusFileName = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath),\r
- "status.json");\r
-\r
+ private readonly string _statusFileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "status.json");\r
public static bool Restoring { get; set; }\r
public int ExperiencePoint { get; set; }\r
public DateTime LastResetTime { get; set; }\r