Hot off the presses (and the download center) come the WF4 Beta 2 samples here. The team has invested a lot of time into these samples and they provide a good way to get up to speed on the way a particular feature or group of features work together.
Note, there are 2300 files to be unzipped, so hopefully there is a sample in here for everyone.
At a high level, we work down the directory structure from technology, sample type, and then some functional grouping of samples.
Within the “Sample Type” we have a few different categories we use.
This sample demonstrates how to write a workflow simulator that displays the running workflow graphically. The application executes a simple flowchart workflow (defined in Workflow.xaml) and re-hosts the workflow designer to display the currently executing workflow. As the workflow is executed, the currently executing activity is shown with a yellow outline and debug arrow. In addition tracking records generated by the workflow are also displayed in the application window. For more information about workflow tracking, see Workflow Tracking and Tracing. For more information about re-hosting the workflow designer, see Rehosting the Workflow Designer.
The workflow simulator works by keeping two dictionaries. One contains a mapping between the currently executing activity object and the XAML line number in which the activity is instantiated. The other contains a mapping between the activity instance ID and the activity object. When tracking records are emitted using a custom tracking profile, the application determines the instance ID of the currently executing activity and maps it back to the XAML file that instantiated it. The re-hosted workflow designer is then instructed to highlight the activity on the designer surface and use the same method as the workflow debugger, specifically drawing a yellow border around the activity and displaying a yellow arrow along the left side of the designer
I will be blogging more on some of the interesting (to me) individual samples. What do you think? Are there samples you’d like to see? How are you using these, is there anything we can do to make these more useful?