Example #1
0
 /// <summary>
 /// すべての折り畳みをトグル
 /// </summary>
 public void ToggleFoldingAll()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ToggleAllFoldings();
     }
 }
Example #2
0
 /// <summary>
 /// アクティブなエディタの選択しているテキストを切り取る
 /// </summary>
 public void CutText()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.CutText();
     }
 }
Example #3
0
 /// <summary>
 /// 定義をすべて折りたたむ
 /// </summary>
 public void FoldingDefAll()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ShowDefinitionsOnly();
     }
 }
Example #4
0
        public void ChangeActiveEditor(Editors.IEditor editor)
        {
            AllowKeyboardToMoveConsole = true;

            if (ActiveEditor != null)
            {
                ActiveEditor.OnDeselected();
                borderConsole.IsVisible = false;
            }

            if (OpenEditors.Contains(editor))
            {
                ActiveEditor = editor;
                ActiveEditor.OnSelected();
                ToolsPane.RedrawPanels();

                borderConsole.IsVisible = true;
                borderConsole.SetContent(ActiveEditor.Surface, ActiveEditor.Renderer);

                //Consoles.Children.Insert(0, ActiveEditor.RenderedConsole);
                RefreshBorder();


                if (ToolsPane.PanelFiles.DocumentsListbox.SelectedItem != editor)
                {
                    ToolsPane.PanelFiles.DocumentsListbox.SelectedItem = editor;
                }
            }
        }
Example #5
0
 /// <summary>
 /// アクティブなエディタの選択範囲のコメント化・コメント解除を行う
 /// </summary>
 public void ToggleComment()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ToggleComment();
     }
 }
Example #6
0
 /// <summary>
 /// アクティブなエディタの選択しているテキストを削除する
 /// </summary>
 public void DeleteText()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.DeleteText();
     }
 }
Example #7
0
 /// <summary>
 /// アクティブなエディタのテキストを全選択する
 /// </summary>
 public void SelectAllText()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.SelectAllText();
     }
 }
Example #8
0
 /// <summary>
 /// アクティブなエディタの選択しているテキストを貼り付ける
 /// </summary>
 public void PasteText()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.PasteText();
     }
 }
Example #9
0
 /// <summary>
 /// エディタを分割/解除する
 /// </summary>
 public void ShowSplit()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Split();
     }
 }
Example #10
0
 private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Node.Parent == treeView1.Nodes[0] && e.Button == MouseButtons.Left)
     {
         ActiveEditor.AppendText((ActiveEditor.Text[ActiveEditor.Text.Length - 1] == ' ' ? "" : " ") + e.Node.Text);
     }
 }
Example #11
0
 /// <summary>
 /// コメントアウトする
 /// </summary>
 public void CommentOut()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.DoCommentOut();
     }
 }
Example #12
0
 /// <summary>
 /// コメントアウトを解除する
 /// </summary>
 public void UnCommentOut()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.DoUncommentOut();
     }
 }
Example #13
0
 /// <summary>
 /// 現在のカーソル行をブックマーク登録する
 /// (すでに登録されているときは解除する)
 /// </summary>
 public void ToggleBookmarkSelectedLine()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ToggleBookmarkSelectedLine();
     }
 }
Example #14
0
 /// <summary>
 /// 現在アクティブなエディタの編集状態を一つ前に元に戻す
 /// </summary>
 public void Undo()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Undo();
     }
 }
Example #15
0
 /// <summary>
 /// 前のブックマークへカーソルを移動
 /// </summary>
 public void MovePrevBookmark()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.MovePrevBookmark();
     }
 }
Example #16
0
 /// <summary>
 /// 指定した行へカーソルを移動する
 /// </summary>
 /// <param name="lineNumber">指定行</param>
 public void MoveCaretLine(int lineNumber)
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.MoveCaretLine(lineNumber);
     }
 }
Example #17
0
        private void Print_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (MainTab == null)
            {
                return;
            }

            var tab = (CTTabItem)(MainTab.SelectedItem);

            if (tab == null)
            {
                return;
            }

            if (tabToContentMap.ContainsKey(tab))
            {
                var o = tabToContentMap[tab];
                if (o is OnlineHelpTab)
                {
                    ((OnlineHelpTab)o).Print();
                }
                else
                {
                    if (ActiveEditor != null)
                    {
                        ActiveEditor.Print();
                    }
                }
            }
        }
Example #18
0
 /// <summary>
 /// 対応する括弧へ移動
 /// </summary>
 public void MoveMatchingKakko()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.MoveMatchingKakko();
     }
 }
Example #19
0
 /// <summary>
 /// アクティブなエディタの編集状態を元に戻していた場合、それを取り消す
 /// </summary>
 public void Redo()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Redo();
     }
 }
Example #20
0
 public void SaveEditor()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Save();
     }
 }
Example #21
0
 /// <summary>
 /// 折りたたみトグル
 /// </summary>
 public void ToggleFolding()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ToggleFolding();
     }
 }
Example #22
0
 /// <summary>
 /// 検索を行う
 /// </summary>
 /// <param name="option"></param>
 public void Search(EditorSearchOption option)
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Search(option);
         //ActiveEditor.MarkSearchString(option);
     }
 }
Example #23
0
 /// <summary>
 /// ブックマークをすべてクリアする
 /// </summary>
 public void ClearAllBookmark()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.ClearAllBookmark();
         GlobalStatus.FormManager.BookmarkListForm.RemoveBookmarkAll();
     }
 }
Example #24
0
 private void DisposeOldEditor()
 {
     if (ActiveEditor != null)
     {
         ActiveEditor.Dispose();
     }
     ActiveEditor = null;
 }
        /// <summary>
        ///     Show the editor with the selectedObject selected.
        /// </summary>
        /// <param name="selectObject">The object to be selected in the editor</param>
        public void Show(object selectObject)
        {
            ActiveEditor?.Close();

            ActiveEditor = new RuntimeEditor();
            ActiveEditor.Show();
            ActiveEditor.Closed        += runtimeEditor_Closed;
            ActiveEditor.SelectedObject = selectObject;
        }
Example #26
0
        /// <summary>
        /// 現在選択している文字列を返す
        /// </summary>
        /// <returns></returns>
        public string GetSelectedText()
        {
            if (ActiveEditor != null)
            {
                return(ActiveEditor.GetSelectedText());
            }

            return("");
        }
Example #27
0
        private void menuEditPaste_Click(object sender, EventArgs e)
        {
            if (ActiveEditor == null)
            {
                return;
            }

            ActiveEditor.Paste();
        }
Example #28
0
 /// <summary>
 /// 置換を行う
 /// </summary>
 /// <param name="editorSearchOption">検索オプション</param>
 public void Replace(EditorSearchOption option)
 {
     if (ActiveEditor != null)
     {
         EditorSearchResult ret = ActiveEditor.Search(option);
         if (ret != null && ret.IsHit == true)
         {
             ActiveEditor.ReplaceSelectedText(option);
         }
     }
 }
Example #29
0
 /// <summary>
 /// 現在のカーソル位置に文字を挿入する
 /// </summary>
 /// <param name="text">挿入する文字列</param>
 /// <param name="selectedClear">現在選択文字列があるときはクリアするかどうか(trueのときクリアする)</param>
 public void InsertText(string text, bool selectedClear)
 {
     if (ActiveEditor != null)
     {
         if (selectedClear)
         {
             ActiveEditor.ClearSelectedText();                           //選択状態解除
         }
         ActiveEditor.InsertText(text);
     }
 }
Example #30
0
        private FileOperationResult SaveProjectAs()
        {
            SaveFileDialog dlg = new SaveFileDialog();

            if (this.ProjectFileName != null)
            {
                dlg.FileName = new FileInfo(this.ProjectFileName).Name; // propose current file name as new name
            }
            dlg.InitialDirectory = Settings.Default.LastPath;
            dlg.Filter           = CreateSaveProjectFilter();

            bool isInvalidPath = true;

            do
            {
                try
                {
                    if (dlg.ShowDialog() != true) // nullable bool? may be null or false
                    {
                        return(FileOperationResult.Abort);
                    }
                }
                catch (Exception) // if dialog raises a Win32Exception, we silently retry again once with another InitialDirectory (addresses #362)
                {
                    dlg.InitialDirectory = personalDir;
                    if (dlg.ShowDialog() != true)
                    {
                        return(FileOperationResult.Abort);
                    }
                }

                isInvalidPath = Path.GetFullPath(dlg.FileName).StartsWith(defaultTemplatesDirectory);
                if (isInvalidPath)
                {
                    MessageBox.Show(Properties.Resources.WritingInTemplatesNotAllowed,
                                    Properties.Resources.TemplateUseDifferentDirectory, MessageBoxButton.OK, MessageBoxImage.Information);
                    dlg.InitialDirectory = personalDir;
                    dlg.FileName         = new FileInfo(dlg.FileName).Name;
                }
            }while (isInvalidPath);

            this.ProjectFileName = dlg.FileName; // dialog successful

            ActiveEditor.Save(this.ProjectFileName);
            ActiveEditor.Presentation.ToolTip = this.ProjectFileName;
            recentFileList.AddRecentFile(this.ProjectFileName);

            if (Settings.Default.useLastPath)
            {
                Settings.Default.LastPath = Directory.GetParent(ProjectFileName).FullName;
            }

            return(FileOperationResult.Continue);
        }