-
Notifications
You must be signed in to change notification settings - Fork 0
Method Editor
The View Editor is accessible using the entity Ribbon Bar or the design surface context menu. When you click on “Add Method”, you will be presented a dialog box like this one:
There are 3 types of methods that you can create using this dialog box:
-
CMQL methods which are written using CMQL.
-
Snippets with signature. Snippets are coded using a target language (C#, SQL, or anything else). They include a function or a method declaration, possibly including parameters, whatever how this is expressed in the target language.
-
Snippets without signature. Snippets without signature are coded using a target language (C#, SQL, or anything else) but are just bodies of a function, without method declaration. It means the method is a CodeModeler method, defined elsewhere at project level.
If you choose “CMQL”, an advanced text box will be shown. This text box supports CMQL auto-completion. For example, here we have typed “lo” and the auto-completion displays the possible CMQL methods, accompanied with a tooltip window:
Note: The “Rule” CMQL method type is obsolete and not supported so you must not declare a CMQL method using this method type
Now we continue, we have added an Age parameter (matches the Age property on that entity) and the auto-completion proposes a list of clauses:
And here is final method. As you see, it’s very easy to write:
Once a method has been declared, you can double click on it in the entity shape to open the CMQL editor and modify it.
CMQL supports raw and load raw, search raw, count raw and delete raw methods.
As soon as you start typing the editor will detect one of these methods and update its UI like this:
Or this
As you can see a method can have multiple bodies, each being associated with a final language such as T-SQL or P-SQL, etc. Producers will only bodies that targets them.
If you choose a snippet method, you will see a dialog box like this:
In a snippet, you can add any code you want. This code will be injected “as is” in the final output file.
The snippet method editor supports syntax coloring (but not auto-completion) for C# and VB.NET.
- Introduction
- Architect Guide
- Concepts
- Using Visual Studio
- Overview
- Creating a CodeModeler Project
- Visual Environment
- Project Hierarchy
- Design Surface
- Customizing Design Surfaces
- Ribbon Bar
- Property Grid
- Member Format Expressions
- Model Grid
- Method Editor
- View Editor
- Instance Editor and Grid
- Resources Editor
- Inferred Model Viewer
- Building
- Project Physical Layout
- Source Control Support
- Generating
- Aspect Oriented Design (AOD)
- Developer Guide
- The Business Object Model (BOM)
- CodeModeler Query Language (CMQL)
- Starting Guide - Tutorial
- Upgrade From CFE