|
5 | 5 | using System.IO;
|
6 | 6 | using System.Text;
|
7 | 7 | using System.Drawing;
|
8 |
| -using System.Threading; |
9 | 8 | using System.Reflection;
|
10 | 9 | using System.Collections;
|
11 | 10 | using System.Diagnostics;
|
12 | 11 | using System.Windows.Forms;
|
13 | 12 | using System.ComponentModel;
|
14 | 13 | using System.Collections.Generic;
|
15 | 14 | using System.Text.RegularExpressions;
|
16 |
| -using System.Runtime.InteropServices; |
17 | 15 | using ScintillaNet.Configuration;
|
18 | 16 | using PluginCore.Localization;
|
19 | 17 | using FlashDevelop.Controls;
|
|
23 | 21 | using FlashDevelop.Helpers;
|
24 | 22 | using FlashDevelop.Dialogs;
|
25 | 23 | using FlashDevelop.Settings;
|
26 |
| -using WeifenLuo.WinFormsUI; |
27 | 24 | using WeifenLuo.WinFormsUI.Docking;
|
28 | 25 | using ICSharpCode.SharpZipLib.Zip;
|
29 | 26 | using PluginCore.Utilities;
|
@@ -291,7 +288,7 @@ public Boolean ClosingEntirely
|
291 | 288 | /// </summary>
|
292 | 289 | public Boolean IsFirstInstance
|
293 | 290 | {
|
294 |
| - get { return MainForm.IsFirst; } |
| 291 | + get { return IsFirst; } |
295 | 292 | }
|
296 | 293 |
|
297 | 294 | /// <summary>
|
@@ -322,7 +319,7 @@ public ITabbedDocument[] Documents
|
322 | 319 | get
|
323 | 320 | {
|
324 | 321 | List<ITabbedDocument> documents = new List<ITabbedDocument>();
|
325 |
| - foreach (DockPane pane in Globals.MainForm.DockPanel.Panes) |
| 322 | + foreach (DockPane pane in DockPanel.Panes) |
326 | 323 | {
|
327 | 324 | if (pane.DockState == DockState.Document)
|
328 | 325 | {
|
@@ -462,7 +459,7 @@ public Boolean RefreshConfig
|
462 | 459 | /// </summary>
|
463 | 460 | public String[] StartArguments
|
464 | 461 | {
|
465 |
| - get { return MainForm.Arguments; } |
| 462 | + get { return Arguments; } |
466 | 463 | }
|
467 | 464 |
|
468 | 465 | /// <summary>
|
@@ -758,7 +755,7 @@ public void InitializeSmartDialogs()
|
758 | 755 | /// </summary>
|
759 | 756 | private DialogResult InitializeFirstRun()
|
760 | 757 | {
|
761 |
| - if (!this.StandaloneMode && MainForm.IsFirst && FirstRunDialog.ShouldProcessCommands()) |
| 758 | + if (!this.StandaloneMode && IsFirst && FirstRunDialog.ShouldProcessCommands()) |
762 | 759 | {
|
763 | 760 | return FirstRunDialog.Show();
|
764 | 761 | }
|
@@ -1180,7 +1177,7 @@ public void OnMainFormClosing(Object sender, System.ComponentModel.CancelEventAr
|
1180 | 1177 | {
|
1181 | 1178 | String title = TextHelper.GetString("Title.ConfirmDialog");
|
1182 | 1179 | String message = TextHelper.GetString("Info.AreYouSureToExit");
|
1183 |
| - DialogResult result = MessageBox.Show(Globals.MainForm, message, " " + title, MessageBoxButtons.YesNo, MessageBoxIcon.Question); |
| 1180 | + DialogResult result = MessageBox.Show(this, message, " " + title, MessageBoxButtons.YesNo, MessageBoxIcon.Question); |
1184 | 1181 | if (result == DialogResult.No) e.Cancel = true;
|
1185 | 1182 | }
|
1186 | 1183 | if (!e.Cancel) this.CloseAllDocuments(false);
|
@@ -1335,7 +1332,7 @@ public void OnDocumentClosing(Object sender, System.ComponentModel.CancelEventAr
|
1335 | 1332 | {
|
1336 | 1333 | String saveChanges = TextHelper.GetString("Info.SaveChanges");
|
1337 | 1334 | String saveChangesTitle = TextHelper.GetString("Title.SaveChanges");
|
1338 |
| - DialogResult result = MessageBox.Show(Globals.MainForm, saveChanges, saveChangesTitle + " " + document.Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); |
| 1335 | + DialogResult result = MessageBox.Show(this, saveChanges, saveChangesTitle + " " + document.Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); |
1339 | 1336 | if (result == DialogResult.Yes)
|
1340 | 1337 | {
|
1341 | 1338 | if (document.IsUntitled)
|
@@ -1467,7 +1464,7 @@ public void OnScintillaControlModifyRO(ScintillaControl sci)
|
1467 | 1464 | if (te.Handled) return; // Let plugin handle this...
|
1468 | 1465 | String dlgTitle = TextHelper.GetString("Title.ConfirmDialog");
|
1469 | 1466 | String message = TextHelper.GetString("Info.MakeReadOnlyWritable");
|
1470 |
| - if (MessageBox.Show(Globals.MainForm, message, dlgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) |
| 1467 | + if (MessageBox.Show(this, message, dlgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) |
1471 | 1468 | {
|
1472 | 1469 | ScintillaManager.MakeFileWritable(sci);
|
1473 | 1470 | }
|
@@ -2727,7 +2724,7 @@ public void FindAndReplaceFrom(Object sender, System.EventArgs e)
|
2727 | 2724 | {
|
2728 | 2725 | ToolStripItem button = (ToolStripItem)sender;
|
2729 | 2726 | String file = ((ItemData)button.Tag).Tag;
|
2730 |
| - ((Form)PluginBase.MainForm).BeginInvoke((MethodInvoker)delegate |
| 2727 | + this.BeginInvoke((MethodInvoker)delegate |
2731 | 2728 | {
|
2732 | 2729 | OpenEditableDocument(file);
|
2733 | 2730 | });
|
@@ -2867,7 +2864,7 @@ public void ExtractZip(Object sender, System.EventArgs e)
|
2867 | 2864 | String zipLog = String.Empty;
|
2868 | 2865 | String zipFile = String.Empty;
|
2869 | 2866 | Boolean requiresRestart = false;
|
2870 |
| - Boolean silentInstall = MainForm.Silent; |
| 2867 | + Boolean silentInstall = Silent; |
2871 | 2868 | ToolStripItem button = (ToolStripItem)sender;
|
2872 | 2869 | String[] chunks = (((ItemData)button.Tag).Tag).Split(';');
|
2873 | 2870 | if (chunks.Length > 1)
|
@@ -2949,7 +2946,7 @@ public void RemoveZip(Object sender, System.EventArgs e)
|
2949 | 2946 | String zipLog = String.Empty;
|
2950 | 2947 | String zipFile = String.Empty;
|
2951 | 2948 | Boolean requiresRestart = false;
|
2952 |
| - Boolean silentRemove = MainForm.Silent; |
| 2949 | + Boolean silentRemove = Silent; |
2953 | 2950 | List<String> removeDirs = new List<String>();
|
2954 | 2951 | ToolStripItem button = (ToolStripItem)sender;
|
2955 | 2952 | String[] chunks = (((ItemData)button.Tag).Tag).Split(';');
|
|
0 commit comments