Pre-Requisits


Getting the source code to work

1. Download the project from Codeplex and Unzip it. (I recommend WinRar to do this, as the windows unzip didn't work for zip files on codeplex for me)

2. Change to the build configuration of: InstallVSTemplate and then run (Note: this will appear to do nothing but it installs templates into Visual studio from a build script. The image below shows how to change the Build mode for this and the next step)

Walkthrough4.png

3. Change the Build configuration to Debug mode then run.

4. Visual Studio will launch another Visual studio which uses a different registry set. (ie it runs under the experimental hive so that plugins won't break or interfere with the normal IDE while being developed.)

5. Go to the File Menu -> New -> Project -> C#

Walkthrough1_3.png

6. Select WPF with Event Abstraction as the project type (Selected in the diagram above). Choose a name for the project and click OK to create it.

7. Then a project is opened/created. Double click or Right click -> Design View on the .r2ml file.

8. Click the link to generate the file.

Walkthrough2.png

9. After clicking the link you should be looking at the following display (except that the first rule will be blank)

Walkthrough3_2.png

10. Now that you have that working, you may be eager to try wiring up an event. Read the following section for more instructions

IMPORTANT NOTE: There is currently a bug that requires certain files to be open in Visual Studio for code generation to work. If one of these files is not open a message box should appear. So far these files are believed to be the code view of: the R2ML file; the xaml.cs window code behind file; the code_loop.cs and actions.cs files.

Tutorials

In the previous section you downloaded the sourcce code from codeplex. With that source code zip file there is a folder called "Example Projects". That folder has a number of tutorials that demonstrate the implementation of various usecases. To learn how to use this API it is recommended that you use and understand the code in the tutorials. If you find a usecase that you would like and is not present then please add a comment to this site or contact me through this website. After understanding how code is implemented it would be adventageous to readers to learn the Concepts of what this framework offers so that you can learn how to encorporate it into development.

Adding EventAbstraction to an Existing project

Some users may be interested in adding Event Abstraction Techniques to an existing project. For a project to be compatible with this API it must currently have one WPF window. If this is your situation then you should right click on the project and Add->New Item to the project (Note: do not use the file menu as the template is not added there). Select "R2ML Document", enter a name for it and click OK. Once the project is built the API should discover the WPF Window and it should create a folder and generate the two classes that handle and capture events. Finally right click on the r2ml file from the solution explorer and click properties. In the Properties windows change the build action to embedded resource.

Getting r2ml Code completion to work (optional/not supported yet)

Currently you need to copy the r2ml schema(s) (*.xsd) and copy into the Visual Studio Schemas directory. The directory is <visual studio directory>\xml\schemas. The main r2ml xsd is avaliable in the R2ML project under the schemas folder. There are other schemas that the R2ML schema depends on so it is important to copy the folders in the directory with R2ML.xsd . Then you should get xml code completion. Code completion is not nessasary to use this API.

Note: I will eventually encorporate schema deployment and upgrade to the latest version of r2ml.

Last edited Feb 24, 2008 at 10:00 PM by rhwilburn, version 30

Comments

No comments yet.