Fixed version of SQLDatabase activity to work with RC1 of WF

Tonight I have been working to prepare for my Windows Workflow Seminar I will be giving next week.

I thought it would be fun to try to port all my demos to the RC1 of .NET 3.0 running on my RC1 version of Vista. (Sorry could not resist the challengeJ)

During the recreation of a demo on Compensations I use the SqlDatabaseActivity that you can download here. This activity is very helpful in demonstrating how I can do Atomic transactions and what the difference is with long running activities and the option to run compensational logic when things go wrong in a separate transaction in the same compensatableSequenceActivity.

I downloaded the latest version of the SQLDatabaseActivity and compiled it on my local machine.

The next step for me was to drag and drop the database activity on the design surface. But there I found some new behavior I did not see before. Once I dropped the activity on the designer surface, I was able to see the properties for the SQLDatabaseActivity, but it would not appear on the designer surface. After editing one property of the activity it would disappear completely.

So I decided to add the activity manually in code and after switching back to the design mode, I got an big ugly red cross on the screen with the error message: “Theme properties can only be changed in the Theme Configuration Dialog.”  After some digging around in the sources of the SqlDatabaseActivity I found that the author did some Theme property changes in the initialization of the designer that he created to make the activity look fancier.

After removing those statements it all works fine again.

The statements you need to change are located in the file sqldatabaseDesigner.cs. Method Initialize().

Remove the lines:

this.DesignerTheme.BackColorStart = Color.White;

this.DesignerTheme.BackColorEnd = ColorTranslator.FromHtml("#F9CB5A");

this.DesignerTheme.BackgroundStyle = System.Drawing.Drawing2D.LinearGradientMode.Vertical;

this.DesignerTheme.BorderColor = ColorTranslator.FromHtml("#BF8311");