Exemplo n.º 1
0
 /// <summary>
 /// Closes the current project
 /// </summary>
 internal static void CloseProject()
 {
     if (Main.Instance.TrackMap != null)
     {
         Main.Instance.TrackMap.Close();
         Main.Instance.TrackMap.Dispose();
         Main.Instance.TrackMap = null;
     }
     if (Main.Instance.SceneryPanel != null)
     {
         Main.Instance.SceneryPanel.Close();
         Main.Instance.SceneryPanel.Dispose();
         Main.Instance.SceneryPanel = null;
     }
     Status.FileName = null;
     Status.Visible  = false;
     EditorFile.Reset();
     Main.Instance.DockPanel.Refresh();
 }
Exemplo n.º 2
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && ModifierKeys == Keys.Control)
     {
         var p = PointToPlace(e.Location);
         var b = Selection.Clone();
         CaretVisible = false;
         Selection    = new Range(this, p, p);
         var w = SelectWord();
         var r = Selection.Clone();
         var s = !r.IsEmpty ? Selection.Chars.First().style : StyleIndex.None;
         Selection    = b;
         CaretVisible = true;
         if (s.HasFlag(EditorSyntax.StyleMap.Path))
         {
             EditorFile.TryOpen(File, w);
         }
     }
     else
     {
         base.OnMouseDown(e);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Finds selected code fragment on map
 /// TODO: write code! :)
 /// </summary>
 /// <param name="file"></param>
 internal void FindCodeFragmentOnMap(EditorFile file)
 {
     var text   = file.Text;
     var offset = file.Editor.SelectionStart;
 }
Exemplo n.º 4
0
 private void RunMenuItem_Click(object sender, EventArgs e)
 {
     EditorFile.Run();
 }
Exemplo n.º 5
0
 private void SaveMenuItem_Click(object sender, EventArgs e)
 {
     EditorFile.SaveAll();
 }