LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

New features in Visual Basic 10

YEEEEEEEEEEEEHA šŸ˜€ the spelling checker didnā€™t like that one), here are some of the new features in VB 10. And yes, I did sound happy there, because some of these features are really not optional but much needed. Like the multi-line lambda and the sub lambda. You can find the whole video on [Channel9][1] Multi-line lambdas will look like this myfunction.lambdathing(Function(e) e.dosomething e.dosomethingelse End Function)``` Or like this ```vbnet myfunction.lambdathing(Sub() dosomething dosomethingelse End Sub)``` Now this will also be possible. And I’m very happy about that. ```vbnet myfunction.lambdathing(Sub() dosomething)``` They will also support auto properties and collection initializers, neither of which I really needed. I’m so happy, I think I will stick with VB for a while. Although all the catching up to C# thing is annoying. I just hope it doesn’t become a VS 2011 or later version. Let’s make it a VS 2010 that came out in 2009 version shall we? And here is some other stuff that should be possible. ```vbnet Private Sub SomeMethod() Dim _counter as Integer = 1 AddHandler Button1.Click, Sub() _counter += 1 TextBox1.text = _counter End Sub``` ```vbnet Private Sub SomeMethodRunningInAnotherThread() Me.Dispatcher.Invoke(Normal, Sub() 'Do some other stuff SomeTextBox.Text = "Test" End Sub) End Sub``` Info found after some random surfing on [StackOverflow][2] [1]: http://channel9.msdn.com/posts/Dan/Lucian-Wischik-and-Lisa-Feigenbaum-Whats-new-in-Visual-Basic-10/ [2]: http://stackoverflow.com/questions/249314/multiline-lambdas-in-vb-10

Read More...

Can't go to PDC 2008, watch the videos on Channel 9 and on the PDC 2008 site

So you think you missed out because you were not able to go to the Microsoft Professional Developers Conference, think again, the only thing you won’t get by visiting these two links is the hard drive that they gave to the attendees There are 16 pages of videos on Channel 9 Videos on Channel 9: http://channel9.msdn.com/tags/PDC2008/ PDC2008 site: http://microsoftpdc.com/

Read More...

The new features in C# 4.0

Microsoft has made available a document showing the new features in C# 4.0. The new features in C# 4.0 fall into four groups: Dynamic lookup Dynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime. Named and optional parameters Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position.

Read More...

.Net and a problem with unicode and ToLower and ToUpper

I am watching another dnrTV webcast, this time featuring Kathleen Dollard. The webcast is about the difference between VB.Net and C# for the .Net 3.5 framework. An interesting point came up where Kathleen says that casting to lower with unicode can be a security risk, more so then casting to upper. She was talking about an article in Visual Studio magazine by Bill McCarthy about this subject but I canā€™t find it. Anyway, it is always better to use string.EqualsIgnoreCase(ā€œtestā€) than it is to do string.ToLower.Equals(ā€œtestā€). Iā€™ll just take her word for it ;-).

Read More...

Azure Services Platform Is In CTP

The Azure Services Platform is in CTP, here are some details: What is the Azure Services Platform? The Azure Services Platform (Azure) is an internet-scale cloud services platform hosted in Microsoft data centers, which provides an operating system and a set of developer services that can be used individually or together. Azure’s flexible and interoperable platform can be used to build new applications to run from the cloud or enhance existing applications with cloud-based capabilities. Its open architecture gives developers the choice to build web applications, applications running on connected devices, PCs, servers, or hybrid solutions offering the best of online and on-premises.

Read More...

Dependency Injection Tool StructureMap 2.5 Has Been Released

StructureMap is a Dependency Injection tool written in C# for .NET development. StructureMap is also a generic “Plugin” mechanism for flexible and extensible .NET applications. The new functionality in StructureMap 2.5: Completely revamped Assembly scanning options Cleaner, more predictable way to initialize a Container. StructureMapConfiguration is now deprecated, please use ObjectFactory.Initialize(). Optional setter injection All new abilities to query the configuration of a Container The ability to use StructureMap with ZERO Xml or attributes by default The ability to add services at runtime. You can now programmatically add an entire Assembly at runtime for modular applications that might not want all services to be loaded at startup. An auto mocking container based on Rhino Mocks 3.5. I was a doubter on the validity of AMC, but I’m sold now that I’ve used it Contextual object construction More sophisticated auto wiring rules Supporting NameValueCollection and IDictionary types Far more extensibility Interception and post processing hooks for you AOP enthusiasts. StructureMap will NOT include its own AOP engine, but will allow you to use the runtime AOP technique of your choice. More configuration options in both Xml and the Fluent Interface. Completely revamped the Registry DSL. More options for modular configuration (mix and match Xml configuration or Registry’s at will) ā€” which basically had to trigger: Completely revamped diagnostics, including the Environment Testing support Transparent creation of concrete types that are not explicitly registered Create objects with explicit arguments passed to the container Use the underlying Container independently of ObjectFactory Pluggable auto registration with your own custom Type scanning policies StructureMap is now strong named (thanks to Steve Harman) Pull configuration from the App.config (thanks to Josh Flanagan) Generics fixes (thanks to Derrick Rapp) Download it here: http://sourceforge.net/projects/structuremap

Read More...

How to write a simple dependency resolver webcast

There is a great webcast on dnrTV this week. It shows you everything you need to know about Dependency Injection and Inversion of Control. If these things are a mystery to you, then watch this webcast. It takes 1 hour and 2 minutes. But it is really worth it. And perhaps it will also teach you how TDD works and what benefits that has. This is the short description. James Kovacs shows very clearly how to code up a simple IoC container with just a few lines of code illustrating the concepts of dependency injection, dependency inversion, and inversion of control (IoC).

Read More...

The difference between Invoke and BeginInvoke

As a developer you have the responsibility to stay informed and to continuously learn. Sometimes you can learn from another personā€™s questions and, hopefully, a good answer. Perhaps somebody has had a problem you have never faced. But perhaps you will face that problem in the future and reading about it in the past might get you to find the answer more easily (did that make sense ;-)). So for this reason alone, I read forums all over the place including the one on LessThanDot but more recently the one on StackOverflow too.

Read More...

Silverlight 2 is cool. Or is it?

Silverlight 2 got released about a week ago. And this is what ScottGu promises us. **Silverlight 2 is a cross-platform browser plug-in that enables rich media experiences and .NET RIAs (Rich Internet Applications) within the browser. Silverlight 2 is small in size (4.6MB) and takes only 4-10 seconds to install on a machine that doesnā€™t already have it. It does not require the .NET Framework to be installed on a computer to run ā€“ the Silverlight setup download includes everything necessary to play video or run applications.

Read More...

Why isnā€™t DDD normal in .Net?

Iā€™m reading Jimmy Nilssonā€˜s book about DDD ā€œApplying Domain-Driven Design and Patternsā€œ. And it confirms what I already knew. I use it. But how did I come to be using DDD? Well, I got my education in Java and it seems to me that the use of DDD is the technique that is used there more then in the .Net world. For me DDD is just how any OO language should be thought. Because for me DDD is what OO is all about. Making the Domain model and going from there is also what you get when doing OOA (Object-Oriented Analyse) and OOD (Object-Oriented Design).

Read More...