/// <summary> /// すべての折り畳みをトグル /// </summary> public void ToggleFoldingAll() { if (ActiveEditor != null) { ActiveEditor.ToggleAllFoldings(); } }
/// <summary> /// アクティブなエディタの選択しているテキストを切り取る /// </summary> public void CutText() { if (ActiveEditor != null) { ActiveEditor.CutText(); } }
/// <summary> /// 定義をすべて折りたたむ /// </summary> public void FoldingDefAll() { if (ActiveEditor != null) { ActiveEditor.ShowDefinitionsOnly(); } }
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; } } }
/// <summary> /// アクティブなエディタの選択範囲のコメント化・コメント解除を行う /// </summary> public void ToggleComment() { if (ActiveEditor != null) { ActiveEditor.ToggleComment(); } }
/// <summary> /// アクティブなエディタの選択しているテキストを削除する /// </summary> public void DeleteText() { if (ActiveEditor != null) { ActiveEditor.DeleteText(); } }
/// <summary> /// アクティブなエディタのテキストを全選択する /// </summary> public void SelectAllText() { if (ActiveEditor != null) { ActiveEditor.SelectAllText(); } }
/// <summary> /// アクティブなエディタの選択しているテキストを貼り付ける /// </summary> public void PasteText() { if (ActiveEditor != null) { ActiveEditor.PasteText(); } }
/// <summary> /// エディタを分割/解除する /// </summary> public void ShowSplit() { if (ActiveEditor != null) { ActiveEditor.Split(); } }
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); } }
/// <summary> /// コメントアウトする /// </summary> public void CommentOut() { if (ActiveEditor != null) { ActiveEditor.DoCommentOut(); } }
/// <summary> /// コメントアウトを解除する /// </summary> public void UnCommentOut() { if (ActiveEditor != null) { ActiveEditor.DoUncommentOut(); } }
/// <summary> /// 現在のカーソル行をブックマーク登録する /// (すでに登録されているときは解除する) /// </summary> public void ToggleBookmarkSelectedLine() { if (ActiveEditor != null) { ActiveEditor.ToggleBookmarkSelectedLine(); } }
/// <summary> /// 現在アクティブなエディタの編集状態を一つ前に元に戻す /// </summary> public void Undo() { if (ActiveEditor != null) { ActiveEditor.Undo(); } }
/// <summary> /// 前のブックマークへカーソルを移動 /// </summary> public void MovePrevBookmark() { if (ActiveEditor != null) { ActiveEditor.MovePrevBookmark(); } }
/// <summary> /// 指定した行へカーソルを移動する /// </summary> /// <param name="lineNumber">指定行</param> public void MoveCaretLine(int lineNumber) { if (ActiveEditor != null) { ActiveEditor.MoveCaretLine(lineNumber); } }
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(); } } } }
/// <summary> /// 対応する括弧へ移動 /// </summary> public void MoveMatchingKakko() { if (ActiveEditor != null) { ActiveEditor.MoveMatchingKakko(); } }
/// <summary> /// アクティブなエディタの編集状態を元に戻していた場合、それを取り消す /// </summary> public void Redo() { if (ActiveEditor != null) { ActiveEditor.Redo(); } }
public void SaveEditor() { if (ActiveEditor != null) { ActiveEditor.Save(); } }
/// <summary> /// 折りたたみトグル /// </summary> public void ToggleFolding() { if (ActiveEditor != null) { ActiveEditor.ToggleFolding(); } }
/// <summary> /// 検索を行う /// </summary> /// <param name="option"></param> public void Search(EditorSearchOption option) { if (ActiveEditor != null) { ActiveEditor.Search(option); //ActiveEditor.MarkSearchString(option); } }
/// <summary> /// ブックマークをすべてクリアする /// </summary> public void ClearAllBookmark() { if (ActiveEditor != null) { ActiveEditor.ClearAllBookmark(); GlobalStatus.FormManager.BookmarkListForm.RemoveBookmarkAll(); } }
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; }
/// <summary> /// 現在選択している文字列を返す /// </summary> /// <returns></returns> public string GetSelectedText() { if (ActiveEditor != null) { return(ActiveEditor.GetSelectedText()); } return(""); }
private void menuEditPaste_Click(object sender, EventArgs e) { if (ActiveEditor == null) { return; } ActiveEditor.Paste(); }
/// <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); } } }
/// <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); } }
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); }