November 2006 Entries

C# Generics - Interface declaration
I was challenged recently with a question about generics with constraints. The claim was that it's only a compile flaw that allows your to declare an interface for a generic type with a constraint. Namely that the syntax public interface ISomething <T> where T: SomeClass would pass compilation but would not be useful (runtime) because you can't declare a variable ISomething myVar = new ISomething<SomeClass>(); or something to that extent. I went home feeling a bit uneasy about the discussion, ......

Posted On Thursday, November 2, 2006 9:53 PM | Comments (2)

Workflow Custom Activity - Designer re-hosting
In developing some workflow stuff, ran across the need to create custom activities that "aggregate" other atomic activities into a larger activity. The idea is that Programmer codes some atomic activities, exposes appropriate Dependency Properties Non programmer Uses these atomics and creates processes using the atomic compiled activities Saves these composite activities as a new custom activity Can expose specific parameters for inner activities, but otherwise the activity is "locked" for the end ......

Posted On Thursday, November 2, 2006 4:02 PM | Comments (3)

Workflow custom Loop Activity
I was doing some workflow work and wanted to create a custom loop activity. The project needs it, and it's a great way to learn what (not) to do. The activity is a container that would loop through a list of discrete items (think foreach(string currentValue in ValueList)) and exposes the current loop variable via a bindable DependencyProperty. The basics of the activity are to keep the container in "Executing" mode until all child activities are done. The tricky part is that the whole ActivityExecutionContext ......

Posted On Thursday, November 2, 2006 3:40 PM | Comments (5)