• Products
  • Download
  • Purchase
  • Support
  • Company
Actipro Software company logo
Twitter Follow Actipro RSS Subscribe (RSS Feed)

The Actipro Blog

Tag Cloud

  • aero
  • blog
  • docking
  • editors
  • gauge
  • intelliprompt
  • navigation
  • propertygrid
  • ribbon
  • shared library
  • silverlight
  • syntaxeditor
  • themes
  • views
  • winforms
  • wpf

Latest Twitter News

November 21, 2011 at 11:14 AM
#WPF Studio 2011.2 is out now! Includes enhanced themes for native WPF conrtols and new SyntaxEditor features. http://t.co/uEMCaGPG

September 26, 2011 at 1:25 PM
If you'd like to see our #WPF / #Silverlight SyntaxEditor code editor control ported to Metro, provide feedback here: http://t.co/xXBNIDTi

September 15, 2011 at 8:31 PM
If you want to see SyntaxEditor eventually show up in Win8's #xaml UI, be sure to add your support to this MS thread: http://t.co/FBjz6TuC

August 15, 2011 at 1:47 PM
New SyntaxEditor IntelliPrompt parameter info feature docs/samples ready for the 2011.2 #WPF and #Silverlight releases. http://t.co/ezoYIjv

August 2, 2011 at 2:40 PM
First look at new automated IntelliPrompt parameter info coming to our C#/VB editor control in #WPF / #Silverlight http://t.co/CUz6O1T

Twitter Follow us on Twitter

Month List

  • 2012
    • February (3)
    • January (2)
  • 2011
    • December (2)
    • November (7)
    • October (2)
    • September (1)
    • August (5)
    • July (3)
    • June (6)
    • May (5)
    • April (8)
    • March (4)
    • February (5)
    • January (9)
  • 2010
    • December (9)
    • November (10)
    • October (4)
    • September (8)
    • August (12)
    • July (9)
    • June (7)
    • May (6)
    • April (7)
    • March (6)
    • February (6)
    • January (4)
  • 2009
    • December (2)
    • November (2)
    • October (12)
    • September (3)
    • August (11)
    • July (10)
    • June (6)
    • May (3)
    • April (7)
    • March (6)
    • February (8)
    • January (10)
  • 2008
    • December (10)
    • November (2)
    • October (3)
    • September (5)
    • August (5)
    • July (8)
    • June (4)
    • May (4)
    • April (10)
    • March (8)
    • February (1)
    • January (2)

Category List

  • RSS feed for ActiproActipro (289)
  • RSS feed for Blog SummaryBlog Summary (13)
  • RSS feed for GeneralGeneral (34)
  • RSS feed for In developmentIn development (150)
  • RSS feed for New featuresNew features (140)
  • RSS feed for New productNew product (30)
  • RSS feed for PromotionPromotion (2)
  • RSS feed for SilverlightSilverlight (71)
  • RSS feed for Tips and tricksTips and tricks (4)
  • RSS feed for Visual Studio 2008Visual Studio 2008 (2)
  • RSS feed for Windows FormsWindows Forms (20)
  • RSS feed for Windows VistaWindows Vista (10)
  • RSS feed for WPFWPF (235)
  • RSS feed for XAMLXAML (23)

About Us

Actipro Software is a leading provider of .NET user interface controls for the WPF, Silverlight, and WinForms frameworks, and is most well-known for their SyntaxEditor syntax-highlighting code editor control.

Please take some time to learn more about us and our product offerings.

SyntaxEditor for WPF - Advanced find/replace features demo

April 7, 2009 at 2:58 AM
by Bill Henning (Actipro)

Today we put the finishing touches on the search framework in SyntaxEditor for WPF.  We’re really happy with what we have so far but definitely would like to get your additional feedback once the public beta is released.

I’d like to show off the main find/replace QuickStart in this blog post to illustrate some features.

Search1

And unmodified SyntaxEditor with one tool window containing the search UI control described in a previous blog post

The editor shows some C# code with XML doc comments.  We’ve placed a EditorSearchView control in the tool window on the right.  In case you missed it, that control is described in this previous blog post.  We’ve click the Quick Replace button in the search control to switch to replace mode.  This mode change reveals the replace UI controls via animation.

Note that for the QuickStart, we’ve pre-defined the find/replace text.  We’re going to use a regular expression that looks for XML doc comment lines that start with a tag.  Then we’re going to use regex substitution to put the text 123 after each occurrence.  It’s a silly operation but this is just a sample. :)

Search2

A replace all operation is performed

Next we click the Replace All button.  Note the line modification marks in the editor indicating lines that were changed.  The Find Results tool window now displays information about the operation that took place.

Behind the scenes, there is an event that fires whenever a search operation is performed in the “view” search object model.  This QuickStart handles that event and updates the Find Results tool window’s contents appropriately based on the ISearchResultSet that is passed.

The ISearchResultSet is a really handy object.  It tells you what type of operation was performed (find next, replace all, etc.), the exact search options that were used (find text, replace text, match case, etc.), the collection of individual results, and whether wrapping occurred.  Each individual ISearchResult gives you the regex captures that were made, the snapshot range of where text was found, and the snapshot range where it was replaced.  From those you can determine the exact text that was found and replaced.

Back to this QuickStart… our results TextBox is read-only and on the first line says some general info about the operation that was performed, just like in Visual Studio.  The remaining lines give the line/char of the match and the actual line of text that contains the result.  All this information is populated from the ISearchResultSet.

Search3

The second result in the results TextBox is double-clicked

As an additional feature, we wanted to show off snapshot translation with this QuickStart.  We’ve talked about that in past blog posts as well.  Basically a snapshot is an immutable copy of the document at a certain time.  Each ISearchResult stores a snapshot range, meaning it gives you the exact snapshot and range within that snapshot in which the match occurred.

In the screen above, I typed NEW TEXT TYPED HERE making the line/char results in the Find Results invalid.  You can see the result from (9,2) is now on line 12. 

Is this a problem for SyntaxEditor?  No, you can double-click on the (9,2) result in the results TextBox and behind the scenes, the QuickStart grabs the ISearchResult for that particular result.  It translates the snapshot range to the current snapshot in the active view.  Then it uses the resulting range to select the replaced text in the SyntaxEditor.  As you can see from the screenshot, the second result was properly selected even though we’ve made multiple edits above it since the actual replace all operation occurred.

You won’t find features like this anywhere else, and it’s touches like this that will make your application user experience much nicer for end users.

As a side note, the source for this QuickStart is included in the samples for SyntaxEditor.  We are making sure we provide simple QuickStarts showing nearly every major feature of SyntaxEditor so that you have a great reference point when working in various feature areas.

Tags: wpf, syntaxeditor
Filed under: Actipro, In development, WPF
Submit to DotNetKicks...
Permalink | Comments (1)

Related posts

SyntaxEditor for WPF - Advanced themes and highlighting style featuresThe past several days we’ve been cleaning up code (running code analysis, fixing XML comment e...Code reviewing in SyntaxEditor for WPF, demoing upcoming intra-text adornments featuresAs mentioned in our previous blog post, we’ve been hard at work on some very major new features for ...WPF Studio integrates with and adds features to the official Microsoft WPF DataGridIn the most recent WPF Studio 2009.1 builds, we've integrated with and enhanced Microsoft's open sou...

Comments

August 18, 2009 at 14:04  

trackback

Actipro Blog 2009 Q2 posting summary

Actipro Blog 2009 Q2 posting summary

The Actipro Blog - WPF and WinForms Development

Comments are closed
Copyright © 1999-2012 Actipro Software LLC. All rights reserved.
Home Actipro Software | Products | Download | Contact Us