示例#1
0
        internal static void Open(AbstractFile file)
        {
            System.WeakReference filep = new WeakReference(file);
            dict.Add(file.filename, filep);

            if (dict.Count % 10 == 0)
            {
                Clean();
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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 { }
        }
示例#4
0
 internal static void RemovePendingChange(AbstractFile file)
 {
     pendingChanges.Remove(file);
     OnPendingChangesStatusChanged();
 }
示例#5
0
 internal static void AddPendingChange(AbstractFile file)
 {
     pendingChanges.Add(file);
     OnPendingChangesStatusChanged();
 }
示例#6
0
 public AbstractEditor(AbstractFile item)
 {
     this.File = item;
     this.Text = item.ToString();
     this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document;
 }
示例#7
0
 public AbstractEditor(AbstractFile item)
 {
     this.File      = item;
     this.Text      = item.ToString();
     this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.Document;
 }
示例#8
0
 public NavPoint(AbstractFile file)
 {
     this.FileIdentify = file.filename;
     this.friendlyName = file.ToString();
 }
示例#9
0
 internal static void RemovePendingChange(AbstractFile file)
 {
     pendingChanges.Remove(file);
     OnPendingChangesStatusChanged();
 }
示例#10
0
        internal static void Open(AbstractFile file)
        {
            System.WeakReference filep = new WeakReference(file);
            dict.Add(file.filename, filep);

            if (dict.Count % 10 == 0)
            {
                Clean();
            }
        }
示例#11
0
 internal static void AddPendingChange(AbstractFile file)
 {
     pendingChanges.Add(file);
     OnPendingChangesStatusChanged();
 }
示例#12
0
 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;
 }
示例#13
0
 public ScriptFileNavPoint(AbstractFile file) : base(file)
 {
 }
示例#14
0
 public NavPoint(AbstractFile file)
 {
     this.FileIdentify = file.filename;
     this.friendlyName = file.ToString();
 }