• 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 (2)
    • 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 (288)
  • RSS feed for Blog SummaryBlog Summary (13)
  • RSS feed for GeneralGeneral (34)
  • RSS feed for In developmentIn development (149)
  • 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 (19)
  • 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.

Code reviewing in SyntaxEditor for WPF, demoing upcoming intra-text adornments features

January 29, 2010 at 9:12 AM
by Bill Henning (Actipro)

As mentioned in our previous blog post, we’ve been hard at work on some very major new features for the WPF SyntaxEditor control, the premier code editor control for Windows Presentation Foundation.  The three areas we’re about code complete with are:

  • Collapsed text
  • Intra-text spacers and intra-text adornment managers
  • Code outlining

Note that the code in the current build 513 has portions of the above already implemented but the next build 514 is where we hope to have the object model about finalized.  We hope to have some samples and documentation for that build too.

Today I wanted to provide a sneak peek for a full source QuickStart that will be included in the next build 514 of WPF Studio.  This is a really neat QuickStart so prepare for a bunch of screenshots!

Code Reviewing QuickStart in action

This QuickStart is intended to show one way you could do code reviews within an app.  SyntaxEditor is the code editor control in use here.  Assume we have some code loaded from another developer and need to review it.  As we review, we’ll mark some sections of code to come back to later.

CodeReview1

In the screenshot above, I as the reviewer determined that the namespace was incorrect.  So I selected the namespace name in the code editor, typed “The namespace is incorrect” in the textbox at the very top and clicked the Add note button.  Poof!  A note appeared in-line with the text.  Notice that the range I selected is now rendered with a yellow background.  But the really cool thing is that there’s also a note icon with drop-down arrow inside the text, between characters.  Is that a real control? 

Yes, that’s actually a PopupButton, which is a control that ships in our Shared Library!  Let’s hover over it with the mouse…

CodeReview2

See the hover effect on the button?  It’s also showing us a tooltip with details about our code review comment.  The text I typed in is green, it tells us by whom and when the comment was created, and gives its status.  Neat stuff… now let’s add one more comment before we go through our notes with the developer.

CodeReview3

Here I added another comment over the public keyword saying that I think it should be internal instead.  Oh but wait… I forgot that we do need this class to be public.  My mistake, so let’s click the note button and choose to remove it.

CodeReview4

Ok, now we’re ready to sit down with the developer of this code and review it.  The developer agrees with me on the first note, it should be another namespace.  So I’ll drop down the note button’s popup menu like this…

CodeReview5

I’m going to select the Mark as Accepted button to say that this comment was accepted. 

CodeReview6

Our note highlight turns green to indicate it was accepted.  If we had marked it as rejected instead, it would have turned red.

SyntaxEditor features involved

What this QuickStart focuses on is a brand new concept, which is intra-text spacers.  Intra-text spacers are a way that you can dynamically reserve space between text characters.  Once you have space reserved, you can place any sort of content in that space, generally via an intra-text adornment manager.

That’s effectively what we do here.  We reserve space for the note button and then use an intra-text adornment manager (we provide a helper base class for this) to aid in adding WPF content in that space.  You can add any sort of content as an adornment… images, controls, anything.

The intra-text space is reserved using a tagger, which is a new framework feature we added in the first WPF Studio 2009.2 release.  There is a special IIntraTextSpacerTag interface that can be used to do this.

For this sample we have our custom tag (that implements IIntraTextSpacerTag) also implement IClassificationTag.  This allows it to provide an alternate background for contained text.

Our adornment manager processes the menu item clicks and removes tags when you click Remove Note, and updates a tag’s status when you click to change status.  An event is raised to let any listeners of these tag types know to update, which in our case is the UI.

Summary

Adding intra-text content is something that has been requested numerous times by customers in the past.  Now this is entirely possible with the upcoming build 514 and opens up a large number of new things you can do with a code editor in your app.

Want to insert in-line icons next to class definitions that better illustrate to the end user the access (public, private, etc.)?  Want to embed something like smart tag buttons directly within text content?  No problem!

Again, this new QuickStart will appear in build 514 so be sure to check it out then.  And as a side note, you won’t find this sort of feature in any of the competition.  We are committed to making SyntaxEditor the hands-down market leader for code editor controls.

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

Related posts

Preview of SyntaxEditor for Silverlight’s code outlining featuresWe’ve been continuing to develop the Silverlight version of our SyntaxEditor control, which is a syn...What features do you want to see in WPF/Silverlight SyntaxEditor’s grammar and AST framework?We get asked all the time when our popular .NET Languages Add-on and Web Languages Add-on for the Wi...Complete code outlining support added to SyntaxEditor for WPFWe just published WPF Studio 2009.2 build 514 and some of its new features are the culmination of ov...

Comments

January 28, 2010 at 09:15  

Eric J. Smith

That's awesome!!  Killer use case... wonder where you got that idea from? Wink

Eric J. Smith United States

January 28, 2010 at 09:16  

trackback

Code reviewing in SyntaxEditor for WPF, intra-text adornments demo!

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com

January 28, 2010 at 09:19  

Bill Henning (Actipro)

Some guy I know. Smile

Bill Henning (Actipro) United States

February 1, 2010 at 17:49  

Mike Strobel

Bloody brilliant.

Mike Strobel United States

March 31, 2010 at 09:39  

trackback

Actipro Blog 2010 Q1 posting summary

Actipro Blog 2010 Q1 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