use cached path

This commit is contained in:
pypy
2020-11-08 14:47:53 +09:00
parent 6c923d6a53
commit c05e884cb5
7 changed files with 17 additions and 10 deletions
+2 -2
View File
@@ -36,8 +36,8 @@ namespace VRCX
catch catch
{ {
} }
// AppDomain.CurrentDomain.BaseDirectory + "/html/index.html" // Program.BaseDirectory + "/html/index.html"
Browser = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/index.html")) Browser = new ChromiumWebBrowser(Path.Combine(Program.BaseDirectory, "html/index.html"))
{ {
DragHandler = new NoopDragHandler(), DragHandler = new NoopDragHandler(),
BrowserSettings = BrowserSettings =
+8 -1
View File
@@ -11,8 +11,15 @@ using System.Windows.Forms;
namespace VRCX namespace VRCX
{ {
public static class Program public class Program
{ {
public static string BaseDirectory { get; private set; }
static Program()
{
BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
}
[STAThread] [STAThread]
public static void Main() public static void Main()
{ {
+1 -1
View File
@@ -22,7 +22,7 @@ namespace VRCX
{ {
m_ConnectionLock = new ReaderWriterLockSlim(); m_ConnectionLock = new ReaderWriterLockSlim();
var dataSource = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "VRCX.sqlite3"); var dataSource = Path.Combine(Program.BaseDirectory, "VRCX.sqlite3");
m_Connection = new SQLiteConnection($"Data Source=\"{dataSource}\";Version=3;PRAGMA locking_mode=NORMAL;PRAGMA busy_timeout=5000", true); m_Connection = new SQLiteConnection($"Data Source=\"{dataSource}\";Version=3;PRAGMA locking_mode=NORMAL;PRAGMA busy_timeout=5000", true);
} }
+1 -1
View File
@@ -15,7 +15,7 @@ namespace VRCX
public static VRCXStorage Instance { get; private set; } public static VRCXStorage Instance { get; private set; }
private static readonly ReaderWriterLockSlim m_Lock = new ReaderWriterLockSlim(); private static readonly ReaderWriterLockSlim m_Lock = new ReaderWriterLockSlim();
private static Dictionary<string, string> m_Storage = new Dictionary<string, string>(); private static Dictionary<string, string> m_Storage = new Dictionary<string, string>();
private static string m_JsonPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "VRCX.json"); private static string m_JsonPath = Path.Combine(Program.BaseDirectory, "VRCX.json");
private static bool m_Dirty; private static bool m_Dirty;
static VRCXStorage() static VRCXStorage()
+2 -2
View File
@@ -66,8 +66,8 @@ namespace VRCX
BindFlags = BindFlags.ShaderResource, BindFlags = BindFlags.ShaderResource,
CpuAccessFlags = CpuAccessFlags.Write CpuAccessFlags = CpuAccessFlags.Write
}); });
m_Browser1 = new Browser(m_Texture1, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?1")); m_Browser1 = new Browser(m_Texture1, Path.Combine(Program.BaseDirectory, "html/vr.html?1"));
m_Browser2 = new Browser(m_Texture2, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?2")); m_Browser2 = new Browser(m_Texture2, Path.Combine(Program.BaseDirectory, "html/vr.html?2"));
m_Thread = new Thread(() => m_Thread = new Thread(() =>
{ {
var active = false; var active = false;
+2 -2
View File
@@ -22,7 +22,7 @@ namespace VRCX
Instance = this; Instance = this;
InitializeComponent(); InitializeComponent();
// //
Browser1 = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?1")) Browser1 = new ChromiumWebBrowser(Path.Combine(Program.BaseDirectory, "html/vr.html?1"))
{ {
DragHandler = new NoopDragHandler(), DragHandler = new NoopDragHandler(),
BrowserSettings = BrowserSettings =
@@ -32,7 +32,7 @@ namespace VRCX
}, },
Dock = DockStyle.Fill, Dock = DockStyle.Fill,
}; };
Browser2 = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?2")) Browser2 = new ChromiumWebBrowser(Path.Combine(Program.BaseDirectory, "html/vr.html?2"))
{ {
DragHandler = new NoopDragHandler(), DragHandler = new NoopDragHandler(),
BrowserSettings = BrowserSettings =
+1 -1
View File
@@ -9,7 +9,7 @@ namespace VRCX
{ {
public class WebApi public class WebApi
{ {
private readonly string COOKIE_FILE_NAME = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cookies.dat"); private readonly string COOKIE_FILE_NAME = Path.Combine(Program.BaseDirectory, "cookies.dat");
public static WebApi Instance { get; private set; } public static WebApi Instance { get; private set; }
private CookieContainer _cookieContainer; private CookieContainer _cookieContainer;