internal static void Open(AbstractFile file) { System.WeakReference filep = new WeakReference(file); dict.Add(file.filename, filep); if (dict.Count % 10 == 0) { Clean(); } }
public static bool TryFind(string identify, out AbstractFile file) { WeakReference fp; if (dict.TryGetValue(identify, out fp)) { if (fp.IsAlive) { file = dict[identify].Target as AbstractFile; return(true); } else { dict.Remove(identify); } } file = null; return(false); }
public void RunDebug() { if (FileManager.PendingChangesCount >= 1) { DialogResult result = MessageBox.Show(this, "您已经修改了本工程。在开始调试前是否需要保存呢?", this.Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); switch (result) { case DialogResult.Cancel: return; case DialogResult.No: break; case DialogResult.Yes: FileManager.ApplyPendingChanges(); break; } } System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(System.IO.Path.Combine(ProjectManager.ProjectDir, "Game.exe")); //System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("cmd.exe"); info.UseShellExecute = false; info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; info.StandardOutputEncoding = Encoding.UTF8; info.StandardErrorEncoding = Encoding.UTF8; info.RedirectStandardError = true; info.RedirectStandardInput = true; info.RedirectStandardOutput = true; System.Diagnostics.Process proc = System.Diagnostics.Process.Start(info); AbstractFile file = (new Debugger.ProcessStandardStreamFile(proc, true)); file.ShowEditor(); try { //TODO: file.Editor.Show(NekoKun.Core.Application.Logger.Editor.Pane, NekoKun.Core.Application.Logger.Editor); } catch { } }
internal static void RemovePendingChange(AbstractFile file) { pendingChanges.Remove(file); OnPendingChangesStatusChanged(); }
internal static void AddPendingChange(AbstractFile file) { pendingChanges.Add(file); OnPendingChangesStatusChanged(); }
public AbstractEditor(AbstractFile item) { this.File = item; this.Text = item.ToString(); this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document; }
public NavPoint(AbstractFile file) { this.FileIdentify = file.filename; this.friendlyName = file.ToString(); }
public static bool TryFind(string identify, out AbstractFile file) { WeakReference fp; if (dict.TryGetValue(identify, out fp)) { if (fp.IsAlive) { file = dict[identify].Target as AbstractFile; return true; } else { dict.Remove(identify); } } file = null; return false; }
public ScriptFileNavPoint(AbstractFile file) : base(file) { }