Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Desktop Developer

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

Tags: vb10

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

Most of you guys don't know what a spectral library is and I forgive ye. But I needed something to test this brand new thing. So I choose something I know and something I know is hard to find.

But this is all about the new VB10. So I started of by downloading the also new Windows 7 RC and VS2010 beta 1. I installed windows 7 on a Virtual machine for Virtual PC.

I already had some code for VS2008 and I used that to start. I will be uploading the whole thin gin the near future.

I will use the following frameworks.

Short brief for the project: Open spectrum files and save them in a database or export them to another file. Show the spectrum on the screen in a graph. Do this for the following type MSP, FT-IR and Raman spectrometer results. Do some basic manipulation on the spectra.

All three types are different. and have there own set of rules.

But lets move on.

I open the VS2008/Framework 3.5 solution in VS2010 and the same import wizard shows up as we had it in VS2008 so click finish and be done with it.

It then goes on to open my solution in the VS2010 format (I guess) and I get the first errors.

It seems as though it can't find System.Windows.Forms.DataVisualization but I'm sure I read somewhere that this is now part of the 4.0 framework. So I guess like VS2008 VS2010 keeps the framework your project was compiled for. Time to change that.

Right-click on the project pick Properties, pick Compile, blah blah, jada jada, see picture.

We change the framework to 4.0 and voila there we have it the first problem solved everything is now ready to go for us. Lets see if it runs.

and it does.

Next step was to test those lambda expressions.

I had this in VB9 to configure structuremap.

  1. Public Shared Sub Initialize()
  2.             StructureMap.ObjectFactory.Configure(Function(x) Configure(x))
  3.         End Sub
  4.  
  5.         Private Shared Function Configure(ByVal x As StructureMap.ConfigurationExpression) As Boolean
  6.             x.ForRequestedType(Of Forms.Interfaces.IMain).AsSingletons.TheDefault.Is.OfConcreteType(Of Forms.Main)()
  7.             x.ForRequestedType(Of Forms.Interfaces.IMsp).TheDefault.Is.OfConcreteType(Of Forms.Msp)()
  8.             x.ForRequestedType(Of Controllers.Interfaces.INavigation).TheDefault.Is.OfConcreteType(Of Controllers.Navigation)()
  9.  
  10.             x.SetAllProperties(Function(y) SetTheProperties(y))
  11.         End Function
  12.  
  13.         Private Shared Function SetTheProperties(ByVal y As StructureMap.Configuration.DSL.SetterConvention) As Boolean
  14.             y.OfType(Of Forms.Interfaces.IMain)()
  15.             y.OfType(Of Forms.Interfaces.IMsp)()
  16.             Return True
  17.         End Function

And yes we can now do this.

  1. Public Shared Sub Initialize()
  2.             StructureMap.ObjectFactory.Configure(Sub(x)
  3.                                                      x.ForRequestedType(Of Forms.Interfaces.IMain).AsSingletons.TheDefault.Is.OfConcreteType(Of Forms.Main)()
  4.                                                      x.ForRequestedType(Of Forms.Interfaces.IMsp).TheDefault.Is.OfConcreteType(Of Forms.Msp)()
  5.                                                      x.ForRequestedType(Of Controllers.Interfaces.INavigation).TheDefault.Is.OfConcreteType(Of Controllers.Navigation)()
  6.  
  7.                                                      x.SetAllProperties(Sub(y)
  8.                                                                             y.OfType(Of Forms.Interfaces.IMain)()
  9.                                                                             y.OfType(Of Forms.Interfaces.IMsp)()
  10.                                                                         End Sub)
  11.                                                  End Sub)
  12.         End Sub

Woohoo. Let's make that VS2009 shall we ;-).

About the Author

User bio imageChristiaan is a forensic technician who programs on the side, although my function description says that I do IT-things for 90% of the time . I'm an avid VB.NET fan and I use lots of the ALT.Net techniques, like unit-testing, nhibernate, logging, IoC, ...
Social SitingsTwitterLinkedInHomePageLTD RSS Feed
753 views
submit to reddit Digg!FacebookDotnetkicks

Comments and Feedback