57 lines
1.9 KiB
C#
57 lines
1.9 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.IO;
|
|||
|
|
using System.Reflection;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
|
|||
|
|
namespace KGdev.BI3D.Revit.Addin.MainWindow.External.Browser
|
|||
|
|
{
|
|||
|
|
internal static class Program
|
|||
|
|
{
|
|||
|
|
[STAThread]
|
|||
|
|
private static void Main(string[] args)
|
|||
|
|
{
|
|||
|
|
IntPtr zero = IntPtr.Zero;
|
|||
|
|
bool flag = args.Length >= 1;
|
|||
|
|
if (flag)
|
|||
|
|
{
|
|||
|
|
zero = new IntPtr(int.Parse(args[0]));
|
|||
|
|
}
|
|||
|
|
int num = -1;
|
|||
|
|
bool flag2 = args.Length >= 2;
|
|||
|
|
if (flag2)
|
|||
|
|
{
|
|||
|
|
num = int.Parse(args[1]);
|
|||
|
|
}
|
|||
|
|
Application.EnableVisualStyles();
|
|||
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|||
|
|
Queue<string> queue = new Queue<string>();
|
|||
|
|
Queue<string> queue2 = new Queue<string>();
|
|||
|
|
string text = Path.Combine(
|
|||
|
|
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
|||
|
|
".3dbi-for-revit",
|
|||
|
|
"cache"
|
|||
|
|
);
|
|||
|
|
Directory.CreateDirectory(text);
|
|||
|
|
BrowserConfiguration browserConfiguration = new BrowserConfiguration
|
|||
|
|
{
|
|||
|
|
Title = "3DBI",
|
|||
|
|
CachePath = text,
|
|||
|
|
MessageHandle = zero,
|
|||
|
|
Url = Path.Combine(
|
|||
|
|
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
|
|||
|
|
"root",
|
|||
|
|
"index.html"
|
|||
|
|
),
|
|||
|
|
Js2NetObjectName = "revit",
|
|||
|
|
Net2JsObjectName = "fromRevit",
|
|||
|
|
ParentProcessId = num,
|
|||
|
|
Net2JsUpdateStatePartialFunctionName = "updatePartialState"
|
|||
|
|
};
|
|||
|
|
Application.Run(
|
|||
|
|
new BrowserForm(browserConfiguration, new BrowserFunctions(queue), queue, queue2)
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|