The PDC had started, Unfortunately - I'm not there.
Next time I hope :)
Lots of buzz is out there already!
- Visual Studio 2010 and .NET 4.0 CTP is available for download!
- Windows Azure
Windows® Azure is a cloud services operating system that serves as the development, service hosting and service management environment for the Azure Services Platform. Windows Azure provides developers with on-demand compute and storage to host, scale, and manage Web applications on the Internet through Microsoft® data centers.
- More Oslo specifics, follow to this post.
I had no idea.. but but.. but but.. :)
Great thing!
Check Scott's post for all the details.
"What's the story? Well, T4 is a code generator built right into Visual Studio. To be clear, you HAVE THIS NOW on your system…go play. Now's the time to introduce code generation to your company. If you're doing something twice or more, manually, in your company, generate it."
The final release of Silverlight 2 is out.
Download Silverlight 2 SDK, Developer Tools and Expression Blend 2 Here,
Read Scott Gu's post for more details.
One of the common scenarios of casting in daily use of code is the need to check if an instance is of a given type, if so - perform actions on it.
Some developers tend to do as following:
if (foo is Bar)
{
Bar b1 = (Bar)foo;
//Do Stuff..
}
A word about it - this approach is condered wasteful in this case.
This is because the result of whether the instance is of a 'Bar' type is not the only thing that matters in this case, meaning I still need to cast it and perform actions on it as 'Bar' type.
This is better in this case:
Bar b2 = foo as Bar;
if (b2 != null)
{
//Do Stuff
}
In this example, we first perform the cast, next we then simpy check if the casting succeeded.
I decided to write a small helper for this common thing.
Step 1 - Try Cast
public static bool TryCast<T>(object source, out T target) where T : class
{
target = source as T;
return (target != null);
}
//playing around - step 1
Bar b3;
if (Extensions.TryCast<Bar>(foo, out b3))
{
//Do stuff
}
Step 2 - Try Cast & Perform
public static void TryCastPerform<T>(object source, Action<T> action) where T : class
{
T cast;
if (TryCast<T>(source, out cast))
{
action(cast);
}
}
//playing around - step 2
Extensions.TryCastPerform(foo,
(Bar b4) =>
{
//Do Stuff
});
Using Extensions:
Step 3 - Try Cast & Perform Extension
public static void TryCastPerformExt<T>(this object source, Action<T> action) where T : class
{
TryCastPerform<T>(source, action);
}
//playing around - step 3
foo.TryCastPerformExt((Bar b5) =>
{
//Do Stuff
});
Sample code is attached
In order to view the attached files, make sure you enter the specifc post page.
There's a whole buzz about the .NET Framework 4.0, sweet stuff is coming.
Read Damir's post for more information.
Obviously, this isn't everything..
- There will be new modeling and architecture tools for working against the code
- The Team Developer and Database suites will be combined together - Love that!
And much more of course
Visit the CodeProject article for futher details.
Download Dynamite library (including demo) - 35.7KB
The library proides easy way for sorting arrays, enumerables, queryables and dataset as well.
The sweet gem about it is the ability to integrate it into actual runtime needs since it works with string manipulations.