public MainForm(Boolean isFirstRun = false, String installAddonPath = null, Boolean setupIPCTalk = false, Int32 port = -1)
{
Logger.Setup();
#region Culture Independency
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
Properties.Resources.Culture = new CultureInfo("en-GB");
log.Info("Culture independency achieved.");
#endregion
Font = new Font(Font.Name, 8.25f * 96f / CreateGraphics().DpiX, Font.Style, Font.Unit, Font.GdiCharSet, Font.GdiVerticalFont);
InitializeComponent();
offlineServerTalk = new OfflineServerTalk();
addonProject = new AddonProject();
htmlPanel = new HtmlPanel();
htmlPanel.AutoSize = false;
htmlPanel.BorderStyle = BorderStyle.Fixed3D;
htmlPanel.Location = new Point(186, 38);
htmlPanel.Size = new Size(210, 299);
htmlPanel.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
installAddonGroupBox.Controls.Add(htmlPanel);
avalonEditProxyAccent.textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("XML");
avalonEditProxyTheme.textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("XML");
avalonEditProxyLanguage.textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("XML");
avalonEditProxyMemoryPatch.textEditor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("C#");
avalonEditProxyAccent.textEditor.Text = AddonProject.Accent.defaultAccentXaml;
avalonEditProxyTheme.textEditor.Text = AddonProject.Theme.defaultThemeXaml;
avalonEditProxyLanguage.textEditor.Text = AddonProject.Language.defaultLanguageFileText;
if (!String.IsNullOrWhiteSpace(installAddonPath))
{
log.Info("/installAddon was specified, executing run-once installation.");
// handle auto install
}
else
{
if (isFirstRun)
{
if (setupIPCTalk && port != -1)
offlineServerTalk.initialize(port);
BeginInvoke(new MethodInvoker(delegate
{
Hide();
FirstRunForm frForm = new FirstRunForm(this);
frForm.Show();
}));
}
}
}