Fulcrum Toolkit User Quick Start

Overview

The Fulcrum Toolkit is a code generation tool. You pass data in and code comes out the other end. The code generated may be C#, Visual Basic, C++, SQL, etc…. It all depends on what the plugin has implemented and supports.

FulcrumConsole

Currently Fulcrum is only exposed on the command line via FulcrumConsole. To get the set of command line arguments supported run fulcrumconsole.exe -? .

The most important command line argument is the –module one, as it selects which plugin to use. Information about the specific plugins follow.

WeakEventManager

The WeakEventManager plugin generates code which implement a WeakEventManager for a given event exposed by a given class or interface.

The plugin takes a XML configuration file which lists all the classes and events to generate code for. The format of this configuration file can be learned by looking at the WeakEventManagerConfig.xml sample file.

The file is specified using the –config command line parameter.

Running WeakEventManager may look like this:
FulcrumConsole.exe -module:weakeventmanager -output:c:\source -config:WeakEventManagerConfig.xml

DispatcherProxies

The DispatcherProxies plugin generates code which implement a proxy for objects who’s methods & properties can only be called on a given thread. These classes are indented to be used to simplify the task of writing integration tests.

The plugin uses reflection on an assembly to find proxyable types discover their methods/properties.

Running DispatcherProxies may look like this:
FulcrumConsole.exe -module:dispatcherproxy -output:c:\source -TargetAssembly:ProductAssembly.dll

ControlGenerator

ControlGenerator is a plugin which generates the “plumbing” code for implementing WPF/Silverlight controls. It includes support for:
  • Dependency Properties
  • Attached Dependency Properties
  • Routed Events
  • Routed Commands
  • Routed Command Bindings
  • Template Parts

The resulting generated code is a partial class. Partial methods are defined to allow the handwritten half of the class to interact with the generated part – such as provide dependency property value validation.

The plugin takes a XML configuration file which lists all the controls and their settings. The format of this configuration file can be learned by looking at the ControlGeneratorConfig.xml sample file.

The file is specified using the –config command line parameter.

Running ControlGenerator may look like this:
FulcrumConsole.exe -module:controlgenerator -output:c:\source -config:ControlGeneratorConfig.xml

Customizing Code Generation

If the generated code isn’t quite what you want then there are customizations you can perform.

The easiest way is to edit the template file. If the desired level of customization can’t be done with that, then you can modify the source code of the plugin.

Last edited Mar 31, 2010 at 6:47 PM by NathanNesbit, version 1

Comments

No comments yet.