I did a library to process any DGML file. The library serves as the base class for the type provider and the type provider can help me generate some code. I made up a prototype and the source code is check in at F# sample pack. (on Sep 9, 2012 2:17 AM). You can go to "source" and the type provider is under SampleProvider folder.
The DGML file is shown in Visual Studio like:
And the transition code is like:
// set the transition functions
t.SetFunction(t.State0, printObj)
t.SetFunction(t.State1, printObj)
t.SetFunction(t.State2, printObj)
t.SetFunction(t.State3, printObj)
// valid transitions
t.TransitTo_State1()
t.TransitTo_State2()
t.TransitTo_State3()
// invalid transition
t.TransitTo_State2()
Please leave your comments.. :)
No comments:
Post a Comment