[Serializable] DB.NET

.NET development and more (or less)

/// <summary>
/// Daniel Balla's Weblog - Various posts 
/// on .NET Development, ASP.NET, Agile, 
/// TDD, Architecture, SQL and others.
/// </summary>
[Serializable]
class Blog<T> where T : ASP.NET, Ajax, WCF, WF, new()
{
}

Friday, October 06, 2006

Minor bug in WF 3.0 RC1 designer


As stated in my previous post, the WF designer in version beta 2.2 was poor. It was very slow and came up with some non-sense error every 10 minutes or so. The changes in version 3.0 RC are obvious: the designer is still a bit slow but very stable. You can hardly fault it. However, I've noticed a small bug: if you define an event arguments class derived from ExternalDataEventArgs and use it to wire up an event to a handleExternalEventActivity even though it does compile and work just fine the designer shows it as an error (as shown in the image).

Let's take an example. We define an event arguments class inherited from
ExternalDataEventArgs such as:

[Serializable]
public class MyExternalDataEventArgs : ExternalDataEventArgs
{
public MyExternalDataEventArgs(Guid instanceID) : base(instanceID)
{
}
}

Then we define the data exchange interface:

[ExternalDataExchange]
public interface IExternalEvents
{
event EventHandler MyEvent;
}

and then we create a workflow, drag a handle external event activity on the flow and wire it to our IExternalEvents interface and MyEvent event - which translates to:

this.handleExternalEventActivity1.EventName = "MyEvent";
this.handleExternalEventActivity1.InterfaceType = typeof(DerivedWorkflowClass.IExternalEvents);
this.handleExternalEventActivity1.Name = "handleExternalEventActivity1";

Now we can see the error icon, but still we can build the project with no problem, not even a warning.

That being said, sometimes as you come in and out of the designer the error icon disappears and the re-appears, but I couldn't see any patter in this behavior and most of the times the error icon is on.

This issue comes up on RC1 of .NET Framework 3.0 Runtime Components using:
Extensions for Windows WF
Windows Workflow Foundation Tools for Visual Studio

Orcas Technology Preview - .NET Framework 3.0 Development Tools 1.0
Microsoft Visual Studio Code Name Orcas Community Technology Preview - Development Tools for WinFX

I will report the bug on http://connect.microsoft.com/wf tomorrow. However, my point here is that after a month of pretty intense development on WF 3 RC1 this is the only bug I've found and as you can see it is a minor inconvenient so I guess it backs up the previous post proving that it is a stable release.

Labels:

Tuesday, October 03, 2006

What's new in WF 3.0 RC

Don't trust the title, it is misleading. This isn't a real "what's new" article, and I won't bother you with obvious things, such as the removal of FaultHandlerActivity's Fault property setter ... CompensatableTransactionScopeActivity (I thought I use to make up long class names), blah blah blah ... you could read that on http://wf.netfx3.com/ or on Paul Andrew's blog or so on... I just mean to express my surprise on the changes in the WF designer! It is 1000 times more stable and you don't get as many silly errors, and maybe it's just me but I feel it's even moving faster. Cheers for that!
It's amazing how (without acknowledging it) those small fixes in the flaky designer build up your confidence.

Labels:

Monday, October 02, 2006

Event code snippet

Indeed, most times you write the events at a time, maybe in a region and the trigger methods afterwards in another region; but then you do the same with local fields and properties, and yet the prop snippet comes in handy. Therefore I thought a simple event code snippet would be useful. You can download it here and then copy it to your Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C#\ directory








<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>event</Title>
<Shortcut>event</Shortcut>
<Description>Code snippet to created and document an event</Description>
<Author>Daniel Balla</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>event</ID>
<ToolTip>Event name</ToolTip>
<Default>MyEvent</Default>
</Literal>
<Literal>
<ID>eventArgs</ID>
<ToolTip>Event arguments type</ToolTip>
<Default>EventArgs</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[#region Event Handler $event$ ($eventArgs$)
/// <summary>
/// This event is fired when |
/// </summary>
public event EventHandler $event$;
#endregion
#region Event notification $event$
/// <summary>
/// Notifies the listeners of the $event$ event
/// </summary>
/// <param name="e">The argument to send to the listeners</param>
protected virtual void On$event$($eventArgs$ e) {
if($event$ != null) {
$event$(this,e);
}
}
#endregion$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>


Gixen - Free Auction Sniper