mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 06:13:52 +02:00
use cached path
This commit is contained in:
@@ -36,8 +36,8 @@ namespace VRCX
|
||||
catch
|
||||
{
|
||||
}
|
||||
// AppDomain.CurrentDomain.BaseDirectory + "/html/index.html"
|
||||
Browser = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/index.html"))
|
||||
// Program.BaseDirectory + "/html/index.html"
|
||||
Browser = new ChromiumWebBrowser(Path.Combine(Program.BaseDirectory, "html/index.html"))
|
||||
{
|
||||
DragHandler = new NoopDragHandler(),
|
||||
BrowserSettings =
|
||||
|
||||
@@ -11,8 +11,15 @@ using System.Windows.Forms;
|
||||
|
||||
namespace VRCX
|
||||
{
|
||||
public static class Program
|
||||
public class Program
|
||||
{
|
||||
public static string BaseDirectory { get; private set; }
|
||||
|
||||
static Program()
|
||||
{
|
||||
BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace VRCX
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace VRCX
|
||||
public static VRCXStorage Instance { get; private set; }
|
||||
private static readonly ReaderWriterLockSlim m_Lock = new ReaderWriterLockSlim();
|
||||
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;
|
||||
|
||||
static VRCXStorage()
|
||||
|
||||
@@ -66,8 +66,8 @@ namespace VRCX
|
||||
BindFlags = BindFlags.ShaderResource,
|
||||
CpuAccessFlags = CpuAccessFlags.Write
|
||||
});
|
||||
m_Browser1 = new Browser(m_Texture1, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?1"));
|
||||
m_Browser2 = new Browser(m_Texture2, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?2"));
|
||||
m_Browser1 = new Browser(m_Texture1, Path.Combine(Program.BaseDirectory, "html/vr.html?1"));
|
||||
m_Browser2 = new Browser(m_Texture2, Path.Combine(Program.BaseDirectory, "html/vr.html?2"));
|
||||
m_Thread = new Thread(() =>
|
||||
{
|
||||
var active = false;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace VRCX
|
||||
Instance = this;
|
||||
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(),
|
||||
BrowserSettings =
|
||||
@@ -32,7 +32,7 @@ namespace VRCX
|
||||
},
|
||||
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(),
|
||||
BrowserSettings =
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace VRCX
|
||||
{
|
||||
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; }
|
||||
private CookieContainer _cookieContainer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user