internal FindReplaceForm GetFindReplaceForm() { if (_findReplaceForm == null) { _findReplaceForm = new FindReplaceForm(); _topMostForms.Add(_findReplaceForm); } return(_findReplaceForm); }
/// <summary> /// 显示脚本文本查找替换窗口 /// </summary> internal void ShowFindReplaceForm() { GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor); if (this.m_FindReplaceForm == null || this.m_FindReplaceForm.IsDisposed) { this.m_FindReplaceForm = new FindReplaceForm(this); } this.m_FindReplaceForm.Show(this.dockPanel1); if (this.ActiveScriptForm != null) { this.m_FindReplaceForm.DefaultFindText = this.ActiveScriptForm.GetSelectedText(); } this.m_FindReplaceForm.OnRefreshView(); GlobalMethods.UI.SetCursor(this, Cursors.Default); }
/// <summary> /// Constructor</summary> public SyntaxEditorControl() { // Uncomment the next line and use something like // CodeEditor to open a document and see these results. //PerformAndShowAuditStuff(); var doc = new Document { LineModificationMarkingEnabled = true }; doc.Outlining.Mode = OutliningMode.Automatic; Location = new Point(0, 0); Name = "editor"; base.AllowDrop = false; Document = doc; DefaultContextMenuEnabled = true; IntelliPrompt.DropShadowEnabled = true; IntelliPrompt.SmartTag.ClearOnDocumentModification = true; IntelliPrompt.SmartTag.MultipleSmartTagsEnabled = false; LineNumberMarginVisible = true; IndentType = IndentType.Smart; BracketHighlightingVisible = true; SplitType = SyntaxEditorSplitType.FourWay; DocumentIndicatorRemoved += EditorDocumentIndicatorRemoved; SmartIndent += EditorSmartIndent; DocumentSyntaxLanguageLoaded += EditorDocumentSyntaxLanguageLoaded; DocumentIndicatorAdded += EditorDocumentIndicatorAdded; KeyTyping += EditorKeyTyping; ViewMouseHover += EditorViewMouseHover; DocumentTextChanged += EditorDocumentTextChanged; ContextMenuRequested += EditorContextMenuRequested; PasteDragDrop += EditorPasteDragDrop; TriggerActivated += EditorTriggerActivated; ViewMouseDown += EditorViewMouseDown; base.SelectionChanged += SyntaxEditorControlSelectionChanged; m_findReplaceOptions = new FindReplaceOptions(); m_findReplaceForm = new FindReplaceForm(this, m_findReplaceOptions); if (s_imgList == null) s_imgList = ReflectionImageList; // Added by PJO KeyUp += SyntaxEditorControlKeyUp; MouseUp += SyntaxEditorControlMouseUp; Renderer = new VisualStudio2005SyntaxEditorRenderer(); }
/// <summary> /// Dialog to allow the user to perform a find and replace /// </summary> public void FindReplacePrompt() { // define a default value for the text to find mshtmlTextRange range = GetTextRange(); string initText = string.Empty; if (range != null) { string findText = range.text; if (findText != null) initText = findText.Trim(); } // prompt the user for the new href using (FindReplaceForm dialog = new FindReplaceForm(initText, new FindReplaceResetDelegate(this.FindReplaceReset), new FindFirstDelegate(this.FindFirst), new FindNextDelegate(this.FindNext), new FindReplaceOneDelegate(this.FindReplaceOne), new FindReplaceAllDelegate(this.FindReplaceAll))) { DefineDialogProperties(dialog); DialogResult result = dialog.ShowDialog(this.ParentForm); } }