First of all, you need to download this project. It serves both as an example and
as a tutorial at once. You can download it from
http://mform.codeplex.com.
Unzip the project and open it with Visual Studio. Open the current page (~/Start/MyFirstMForm.aspx).
You will notice that the page contains an empty control of type
mf:Root with id MyFirstMForm. You can
switch the editor to design mode.
Currently the MForm control does not look very impressive. It is just a white box
with some text inside. Click this box and then click a little grey box that should
appear on the right. Root Tasks form should appear
with a possibility to change the designer mode. Change the designer mode to edit mode and then press the load a
root template from data definition link.
A generator form will appear. In order to generate the form, you have to choose
the data contract source:
- disk - click "choose", a file open dialog will appear,
select the contract resource type:
- xml schema - xml schema global elements can be generated;
- wsdl file - wsdl global elements can be generated;
- dll managed library - xml serializable object types
can be generated;
then choose a file of the given type and press "Open".
- url - you have to specify a valid url of a .wsdl
or .xsd resource in the contract location and then click "choose"
If you want to generate a sample MForm from Xml schema, you will find some sample
schemas in the example project "Schemas" folder.
If you want to generate something from Wsdl definitions, you can use Bing's public
wsdl: http://soap.search.msn.com/webservices.asmx?wsdl
For the purpose of this example we will however generate a form from a library.
Go to the "bin" folder of example project and choose BM.Tools.WebControls.MForm.Example.dll
file (that's right, we will be generating a form from object definitions that are
in the example project).
After selecting the contract location, we have to choose which element from the
contract should be generated. The element can be found by name in a list box. In
our example we will choose the ToolBoxData element.
When the element is chosen, the element's contract tree will be displayed. It is
possible to generate only a part of the element definition. In order to do it, uncheck
the children that you do not want to generate. Notice that if you unchcheck an element
with children, also the children of this element will not be generated.
Finally press the "Generate" button. You should see the generated form.