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

The Actipro Blog

Tag Cloud

  • blog
  • docking
  • editors
  • intelliprompt
  • micro charts
  • navigation
  • propertygrid
  • ribbon
  • shared library
  • silverlight
  • syntaxeditor
  • themes
  • views
  • web site
  • winforms
  • winrt
  • wpf

Latest Twitter News

May 14, 2012 at 2:50 PM
IntelliPrompt code snippet features have been added to our VS-like code editor control for #WPF and #Silverlight. http://t.co/1IchOJrr

May 10, 2012 at 9:40 PM
Our new Micro Charts control products for #WPF and #Silverlight are out now. Come build some dashboards with them! http://t.co/EEERvff0

May 7, 2012 at 6:47 AM
Today we look at bar charts, for our upcoming #WPF, #Silverlight, and #WinRT Micro Charts product. http://t.co/gxHuPS6B

May 4, 2012 at 6:25 AM
See a gallery of micro area charts in our upcoming release for #WPF, #Silverlight, and #WinRT. http://t.co/qDXGwW8B

May 3, 2012 at 6:32 AM
See a variety of line charts that are easy to make with our upcoming #WPF, #Silverlight, #WinRT Micro Charts product. http://t.co/mbkX6tJd

Twitter Follow us on Twitter

Month List

  • 2012
    • May (9)
    • April (6)
    • March (11)
    • February (11)
    • 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 (321)
  • RSS feed for Blog SummaryBlog Summary (15)
  • RSS feed for GeneralGeneral (43)
  • RSS feed for In developmentIn development (164)
  • RSS feed for New featuresNew features (155)
  • RSS feed for New productNew product (38)
  • RSS feed for PromotionPromotion (2)
  • RSS feed for SilverlightSilverlight (90)
  • RSS feed for Tips and tricksTips and tricks (4)
  • RSS feed for Visual Studio 2008Visual Studio 2008 (2)
  • RSS feed for Windows FormsWindows Forms (22)
  • RSS feed for Windows VistaWindows Vista (10)
  • RSS feed for WinRTWinRT (9)
  • RSS feed for WPFWPF (257)
  • 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 .NET Languages Add-on - Type Inference

April 14, 2011 at 4:35 PM
by Bill Henning (Actipro)

PostBannerSyntaxEditorDevNotes

Today I wanted to provide a quick series of screenshots that demonstrate our type inference features found in the SyntaxEditor .NET Languages Add-on for WPF/Silverlight’s resolver.  These features are still in development and are not yet available in the current build.

Before we begin, be sure to check out our previous blog posts on .NET Languages Add-on development.

What is Type Inference?

Type inference is the ability for the C#/VB resolver (part of our new add-on features) to examine an expression and try to determine its resolved type result.  For instance, say you specify a typeof(int) as an expression.  We know that the C# typeof call always returns a System.Type object, so our resolver attempts to look up the type definition for System.Type in the assemblies you indicate to reference.  Once we have the type definition, we can drive automated IntelliPrompt features.

Type inference is vital for determining what type a variable is that was defined with var, which requires an expression initializer.  It’s also used when examining arguments to methods, since when there are overloads available, it must figure out what type each argument is and compare that to the defined parameter types to pick the best overload for which arguments are present.

Samples

As mentioned in previous posts, we’ve started work on automated IntelliPrompt quick info for the C#/VB languages already.  The following samples will show off type inference features. 

QuickInfo1

In the first screenshot, we are hovering over the WriteLine method.  As we all know, Console.WriteLine has over 10 overloads.  Our type inference engine identified that the x parameter passed into it was a System.Int32 and it found the best WriteLine overload to take an Int32 argument.

QuickInfo2

Now we get a bit more complex.  We still pass in an Int32 parameter x but we create a new implicitly-typed variable called y that has a binary operator expression.  When you add an Int32 and a Double, it results in a Double.  Our engine has logic built-in to recognize these scenarios, so this time when we hover over WriteLine, we get the overload that takes a Double instead.

QuickInfo3

Now let’s switch to generics.  Here, we’ve made a Gen alias for the System.Collections.Generic namespace.  Our list parameter to the method is a List<Double> type.  We create an implicitly-typed variable called item that invokes the indexer of the list.  When we hover over item, we see it is a Double, which is correct since the list is a list of doubles.  There are numerous levels of recursive resolution operations going on here to make it all come together.

QuickInfo4

And finally we hover over WriteLine again, and it appropriately picks the overload that takes a Double.

Summary

This is really very neat stuff, but it’s very time-consuming to code.  Yet we’re working hard on it every day and are taking the time to make sure it provides the best C#/VB code editing experience outside of VS 2010 that is available.  Your end users will really love these features and the intelligence baked into them!

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

Related posts

SyntaxEditor .NET Languages Add-on Adds Generic Type IntelliPromptThe latest build for SyntaxEditor's .NET Languages Add-on now includes complete generic type Intelli...SyntaxEditor .NET Languages Add-on - Anonymous Types In the WPF Studio 2011.2 build that was just released, we added resolver and IntelliPrompt support...SyntaxEditor .NET Languages Add-on - Generic Type IntelliPrompt As mentioned in our previous several blog posts, we’ve been continuing to work on the SyntaxEditor...

Comments

April 15, 2011 at 09:29  

Mike Strobel

Just wait until you have to bind lambda expressions with implicit parameters to generic delegate types with variance (and do so as part of method overload resolution, with multiple compatible candidates).  Then the type inference logic gets even more complicated Smile.  Thankfully, the C# spec tells you exactly what you need to do.

Mike Strobel United Kingdom

July 1, 2011 at 00:22  

trackback

Actipro Blog 2011 Q2 Posting Summary

Actipro Blog 2011 Q2 Posting Summary

The Actipro Blog - WPF, Silverlight, and WinForms Development

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