/// <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(); }
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); } }
/// <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; }
private void RunMenuItem_Click(object sender, EventArgs e) { EditorFile.Run(); }
private void SaveMenuItem_Click(object sender, EventArgs e) { EditorFile.SaveAll(); }