Wednesday, October 7, 2009
Daily Links 10/07/2009
Silverlike
Blog on free silverlight controls and tutorials
Having a PollingDuplex service and any other WCF service in the same website causes Silverlight calls to be slow
What's New in Windows Communication Foundation (WCF) 4.0 Part III - Service-Discovery Feature
Development and Build Environments
Ruining your Test Automation Strategy.
Some thoughts on test automation
Licensing a commercial product
Comparing Windows 7 features
Tuesday, September 29, 2009
Daily Links 29/09/2009
Silverlight Ad Publishing Resources
Creating the Glow Effect in Code
Dynamic TextBlock for Silverlight (TextTrimming property behaviour from WPF)
Silverlight 3 DataGrid : Beyond Databinding
Some handy code bits for silverlight datagrid
Data Performance and Fault Strategies in Silverlight 3
What's New In Windows Communication Foundation (WCF) 4.0 Part- I
Auto-Start ASP.NET Applications (VS 2010 and .NET 4.0 Series)
NCloak
NCloak is a tool to help protect your intellectual property inside your code.
Visual Studio 2010 and .NET Framework 4 Training Kit - May Preview
Had some issues with VS hanging after build the solution - this solved it
Programming for Absolute Beginners
Microsoft supporting web startups and independent web developers by providing free software's for 3years
see also BizSpark for startups & DreamSpark for students
Friday, September 11, 2009
Daily Links 11/09/2009
Get up to speed on SketchFlow FAST
Silverlight and Web Analytics - the Next Generation
Silverlight and localizing string data
Improving the performance of web services in SL3 Beta
Accessing Security and Authentication in Silverlight using .NET RIA Services
5 Minute Overview of MVVM in Silverlight
Export to pdf firefox extension
Bug Shooting
"free screenshot utility that was developed for software tester" "Screenshots can also be sent to Skype or a default E-Mail application"
Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows
Cleaning System volume information for Windows Vista
You can also use windows disk cleanup utility, which will at least save your last restore point.
Telerik Offers Free Developer Team Management Tools
Invaluable if you're using TFS for your work item management. (Supports scrum template)
Wednesday, August 26, 2009
Daily Links 26/8/2009
My latest whitepaper on WCF 4.0
MediaPlayer control included in Silverlight 3
Performance of HTTP polling duplex server-side channel in Microsoft Silverlight 3
Fault support in Silverlight 3
Automatically update the widths of ListView columns - updated!
Silverlight resources
some great sample code to be found here
How to install cool, custom fonts (like PDC09) into Windows and use it in your Silverlight application
A guide to Silverlight 3 new features
iGoogle needs login everytime Firefox restarts? Delete cookies* files in your profile directory
Tuesday, August 4, 2009
Daily Links 04/08/2009
Hack for printing silverlight content
INotifyPropertyChanged: How to remove the Property Name String Code Smell
... or if you cannot settle for the performance hit, use testing to ensure that the correct string is sent with OnPropertyChanged event
Silverlight and WPF Dashboards and gauges
Showing the designer preview in VS2008 with SL3
Creating a Silverlight WCF Binary Encoding Client in Code
Using a Border for a Glow Effect in Silverlight 3
Simplifying the Process of Calling a WCF Service from Silverlight (or any .NET Application)
Handy WCF Techniques
SQL SERVER - 2008 - Copy Database With Data.
Entity Framework 4.0: How to use POCOs
Managed Extensibility Framework (MEF) Preview 6: V1 Feature Complete Silverlight Support and Much More!
Monday, July 13, 2009
Daily Links 13/07/2009
Silverlight RIA Services July Preview
now with go-live licence
Silverlight Toolkit July Release
Pushing Data From the Server to Silverlight 3 using a Duplex Wcf Service
20 Most Interesting Silverlight Tutorials
Silverlight 3 Polling Duplex Chat and Realtime Stock Updates
Creating a ComboBox Style AutoCompleteBox Control in Silverlight
EntitySpaces, Silverlight, and WCF a Fantastic Combination
Everything search
Search files and folders on your NTFS files instantly. It's not an indexing service, so it won't hog your resource like Google Desktop / Windows Search. From the forum: "When I read about it in PCWorld, I thought it might be worth a look. When I saw that it did wildcards (and was portable!), I figured it was definitely worth a try. When I read that it did REGULAR EXPRESSIONS I was certain I wanted it. And when it indexed all my huge volumes in a couple seconds, I nearly had a stroke"
Thursday, June 25, 2009
Event Extensions: Methods for firing events and managing event listeners
In most modern C# applications, generous usage of events have become the norm. Gone are the days where we were afraid to use them because of the "black magic" code that they seemed to execute.
Today, perhaps the opposite is true, and they are used too lightly, with disregard for the memory leeches they are (those small, black slimly kind that you're never aware of what damage they're doing until it's too late).
Here's some code to make usage of the leeches a little easier :).
The typical firing of an event from C# code looks something like this:
1: if (MyEvent1 != null)
2: {3: MyEvent1(this, EventArgs.Empty);
4: } There are 2 essential problems with this code:
- It's too many lines of code for something so mundane.
- What happens if there are more than 1 listeners listening to the event, and one of them throws an exception? Normal .NET behaviour dictates that the other listeners never get to hear about the event, but what if it's important that all listeners know about the event before application execution is halted?
Solution to problem #1: wrap the logic in an extension method
1: MyEvent1.Raise(this, EventArgs.Empty);
there - isn't that better? Here's sample of the implementation:
1: public static void Raise(this EventHandler handler, object sender, EventArgs e)
2: {3: if (handler != null)
4: { 5: handler(sender, e); 6: } 7: } Solution to problem #2: expand on the extension method (now that all the logic is conveniently in one place)
1: MyEvent1.Raise(this, EventArgs.Empty, true);
...where the boolean parameter tells the extension method to make sure that all the event listeners get to hear about the event before throwing an exception. The exception that is then thrown, is an EventListenerException, which is just basically a wrapper for all exceptions that occurred on the event listener's event handling code.
sample implementation: (called from the event extension method)
1: private static void ManageEventListeners(IEnumerable<Delegate> delegates, object sender, EventArgs e)
2: {3: EventListenerException eventListenerException = null;
4: foreach (Delegate listner in delegates)
5: {6: //the listner could throw an unhandled exception in the handler method
7: //make sure that the other listners still handle event if this is the case
8: try
9: {10: listner.DynamicInvoke(new[] {sender, e});
11: }12: catch (TargetInvocationException ex)
13: {14: //add a new event listner
15: EventListener eventListener = new EventListener
16: { 17: Listener = listner, 18: ListenerException = ex.InnerException 19: }; 20: 21: //NOTE: The exception which occurs is "TargetInvokationException", but the
22: //actual exception which occurs in the listner is contained in the innerException
23: 24: //add listner to eventListnerException
25: if (eventListenerException == null)
26: {27: eventListenerException = new EventListenerException();
28: } 29: eventListenerException.EventListenerCol.Add(eventListener); 30: } 31: } 32: 33: //if an exception was thrown by one of the listner's event handlers
34: if (eventListenerException != null)
35: {36: throw eventListenerException;
37: //then re-throw the exception that thrown in the handler
38: } 39: } Here's some sample code with unit tests included in case you need to play with the code (NUnit 2.4.7 & VS 2008)
PS: It's Silverlight compatible (of course :) )