• 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 - Batching up replace operations

December 11, 2008 at 8:46 PM
by Bill Henning (Actipro)

The past several days we’ve been working on a batch update feature.  Before I get into what that means, let’s first discuss how SyntaxEditor for WinForms works. 

The Problem

Each call to SyntaxEditor 4’s Document.InsertText, DeleteText, and ReplaceText methods is its own atomic unit, meaning that UI updates and a lot of other processing occurred after each individual change.  While normally this is ok, sometimes when doing thousands of sequential replace operations in a document, it can take a bit to update.

The Solution

In the next generation text model that we’re prototyping for our SyntaxEditor for WPF control (and will eventually migrate the WinForms control to use it as well), we’ve made a number of improvements for this particular problem.

In the new model, the document class still has InsertText, DeleteText, and ReplaceText methods.  If you call those directly then they will be executed like in the SE4 model.  However you now have an option to call a method named BeginTextChange.  What this does is allows you to start a “group” of replace operations.  Each BeginTextChange must eventually be followed by a corresponding EndTextChange.  The calls may be nested too.  Upon the final EndTextChange call, the batch of replace operations are executed as a single atomic unit.

The object model is such than an ITextChange is a thing that contains some high level data and a list of ITextChangeOperation objects.  Each ITextChangeOperation represents a single replace operation.  So when the document’s TextChanged event fires, it passes along in its event arguments the ITextChange.

A Real-World Sample

As a real world example, say you are going to be performing 1000 replace operations immediately to maybe properly indent 1000 lines of code, so one replace operation for each line of code.  Here is an ideal place to use the Begin/EndTextChange model.  You would start with a call to BeginTextChange, then call ReplaceText for each of your 1000 replace operations, then call EndTextChange.  At the time you call EndTextChange, the single ITextChange (containing 1000 ITextChangeOperation objects) that has been cached up is passed along to the undo mechanism, UI, etc. via the document’s TextChanged event.  Therefore for all these replace operations, the UI and other things only update once, thereby really speeding up response time.

The Bottom Line

I know that a lot of you are anxious to get your hands on SyntaxEditor for WPF and it’s taking a bit to get ready, however I hope that by posting information like this, you can see we’re really focusing on improving core fundamental structures and methodologies.  These things are going to open up a whole new realm of possibilities for the control.  While this does delay the initial release, in the long run we’ll have a far better and more robust product than any of our competition.

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

Related posts

SyntaxEditor for WPF - Advanced find/replace features demoToday we put the finishing touches on the search framework in SyntaxEditor for WPF.  We’r...SyntaxEditor for WPF - Input on find/replace functionalityWe’ve spent the past several days working on find/replace functionality in SyntaxEditor for WP...Actipro SyntaxEditor for WPF and Editors for WPF are released SyntaxEditor for WPF with a custom theme loaded Yesterday evening we published WP...
Comments are closed
Copyright © 1999-2012 Actipro Software LLC. All rights reserved.
Home Actipro Software | Products | Download | Contact Us