Custom Get/Set Accessors
Developers often need to write custom code within the get/set accessors for their properties. However, the DOM Wizard generates code and that code could be re-generated many times. If the developer modifies the generated code, that code will be lost the next time the code is re-generated by the DOM Wizard.
To solve this problem, the DOM Wizard provides an easy way for developers to inject their own code into the generation process. By using the Custom Get/Set Accessor page, developers may write custom code to their specifications and their work will be saved and reinjected each time the DOM Wizard re-generates the code for the project.
You will find the Custom Get/Set Accessors page from the Generate Your Code page. Click the Advanced button and then the Custom Get/Set Accessors menu.
Select the table from the list to the left and the columns in that table will appear to the right. There is a "Get" code box and a "Set" code box to the right of the columns. Check the column(s) for which you would like to write a custom get/set accessors. You will see the default get/set code below the respective code boxes. Write your own custom get/set accessor code and click the "Apply Code To Checked Columns" button to save your changes to the project.
Important: Syntax is highlighted but is not checked. Once the project code is generated by the DOM Wizard, you must open the project in Visual Studio to check the syntax.
If you would like to remove your custom code from all checked columns, click the "Clear Code From Checked Columns" button and the default code will be applied to those checked columns during code generation. Click the "Reset Get/Set" button to remove the code currently in the Get/Set code boxes. Clicking the "Reset Get/Set" button will not impact the code saved in the project.
Click the Close button to return to the DOM Wizard - Generate Your Code page.
To solve this problem, the DOM Wizard provides an easy way for developers to inject their own code into the generation process. By using the Custom Get/Set Accessor page, developers may write custom code to their specifications and their work will be saved and reinjected each time the DOM Wizard re-generates the code for the project.
You will find the Custom Get/Set Accessors page from the Generate Your Code page. Click the Advanced button and then the Custom Get/Set Accessors menu.
Select the table from the list to the left and the columns in that table will appear to the right. There is a "Get" code box and a "Set" code box to the right of the columns. Check the column(s) for which you would like to write a custom get/set accessors. You will see the default get/set code below the respective code boxes. Write your own custom get/set accessor code and click the "Apply Code To Checked Columns" button to save your changes to the project.
Important: Syntax is highlighted but is not checked. Once the project code is generated by the DOM Wizard, you must open the project in Visual Studio to check the syntax.
If you would like to remove your custom code from all checked columns, click the "Clear Code From Checked Columns" button and the default code will be applied to those checked columns during code generation. Click the "Reset Get/Set" button to remove the code currently in the Get/Set code boxes. Clicking the "Reset Get/Set" button will not impact the code saved in the project.
Click the Close button to return to the DOM Wizard - Generate Your Code page.