How to keep certain regions of code in powerdesigner? - powerdesigner

I have an OOM model with a few classes that will be transformed into C++ code.
I want certain sections (ie. custom #includes in .cpp files) to remain untouched when I re-generate the code from the model. However if I modify the model and generate the code again this defines & includes are lost.
Found nothing looking at the docs for macros or variables that may be of help.
Can anyone help?

In the Script tab of a class property sheet, there is a Imports subtab. Looking in the Object Language Definition, this attribute does not seem to be used anywhere.
I managed to use it by editing the Profile\Class\Templates\Source\includes_cpp template in the Language definition, adding %Imports% at the end.
After that, this Imports appears in the generated source:
#include "Class_2.h"
#include "Class_1.h"
MY INCLUDES

Related

How to implement fixed, readonly headers between paragraphs in draft.js?

My editor is split into seperate "sections" eg
History
Examination
Results
Evaluation
which are edited seperately and different semantics (content type) affects functionality inside. Each section would be designated by Header (section title) and Content eg
History
...text here...
Examination
...text here...
The header has to be readonly so that it's content is not editable and header element itself can never be removed.
How would I implement this in draft.js?
A simple solution would be to use several draft instances. This does, however mean that they will have separate undo/redo stacks and copy/paste may not work as you expect.
The alternative solution would be to try to protect the headings, but it would require a lot of work, since you'd have to not only intercept when the user types normally, but also copy/paste and various other things.

link vs compile? When to use?

I ran across this in a book called ng-book by Ari Lerner.
"The compile option by itself is not explicitly used very often; however, the link function is used
very often."
Also, I refer this page but still this confuse me (Difference between the 'controller', 'link' and 'compile' functions when defining a directive)
Can someone justify this a little bit further?
Keep in mind that compile is used to return the linking function that allows the template to be bound to the scope. The cases where you need to interject yourself into this process are mainly limited to the need to actually manipulate the template prior to that binding. One example would be to modify the template based on the attributes set by the user. In short most developers forget about compile unless they need to modify the template. 'Most' are more concerned with the instance of their directive and what to do with the scope bound to that instance (domain of the linking function).
I am using 'Most' very loosely as I have absolutely no data regarding this.

doxygen: html formatting of declaration vs definition in C

question is related to Using Doxygen with C, do you comment the function prototype or the definition? Or both? .
doxygen formatting makes the declaration and its comments from my .h file appear first, followed by the definition and its comments from my .c file. good.
alas, is there some parameter like \param[in] or \return[in] that I can use just before the .c definition for the html output to indicate visually "now I am describing implementation"? It could put a boldface on the left, or even change the color to set it off visually. The obvious \implements tag does not do this.
I looked at the generated doxygen html code, and there is no obvious css class to change. so I presumably should use a tag from http://www.doxygen.nl/manual/commands.html . what do others use?
One option, which is not ideal but does have the merit of simplicity, is to use the \note command.
Prefixing the paragraphs describing the implementation with \note will result in them showing in the output with a green'y-yellow sidebar. You could change the color in the CSS. Subsequent \note paragraphs will remain as separate paragraphs but have a single heading and sidebar.
The downside is that the section is headed Note:. This may or may not be acceptable for your needs.
You could use \xrefitem instead, which would allow you to change the text to Implementation:, but it, quite reasonably, also generates an entry on a separate cross-reference page - which is probably not desirable. There may be a way of disabling the cross-indexing, but there's nothing in the manual about it.
I assume you are generating a document that is for internal use only; some form of Technical Manual perhaps? In which case, the 'Note' option may be the quickest and simplest solution.
Edit: I've just found the \remark command. Essentially equivalent to \note without a sidebar, but the associated heading Remarks may suit your application better. Chances are you can add the sidebar in the CSS.

Ranorex winforms localization issues

I'm trying to write a common test module for a localized application.
The first issue I'm having is the fact that MenuItems do not support controlname attributes. Currently my menu items are located via text or accessiblename attribute. Is there a way to support controlname attribute?
I've tried to make text and accessiblename attribute point to a variable and then bind the variable to some external dictionary. As I understand the external data sources are treated as rows which contain various data items for a single variable. I don't see a way to use external data sources that treat first column as variable name and second column as variable value. Is there a way to achieve such functionality?
I've thought about a way to extend RanorexXPath to accept functions. Then I could write something like ...menuitem[text=localizationService.Translate("#ADMINISTRATION") and have Ranorex find the menu item based on the result of localizationService.Translate function. Is there a way to do this?
Finally I've somewhat managed to get the result I need by using global variables and module variables. What I did was create a module that uses localizationService to fill module variables with correct data. Next I bind the module variables to global parameters and use the data in subsequent test. This is quite error prone and difficult to implement for large number of variables. Is there a way to access and set global variables directly from code (without the need to use binding)?
If any of the 4. points is possible please let me know.
The recomendation from Ranorex support team:
In general only the whole menu is a control in WinForms. The elements within that control (MenuItems) can only be recognized via MSAA.
The problem is that the "Name" attribute of the MenuItems is not accessible.
As workaround I would suggest to use the attribute "AccessibleDescription" in your application in order to automate the menu. This attribute can also be used for language independent names.

Are there any limitations on what libraries can be imported in a t4 template?

We're trying to learn to use T4 Templates. I have a desire to use the System.Data.Entity.Design.PluralizationServices library in order to better pluralize some Entity Model names within my template, but I've come across some issues in the achievement of this goal.
Running code to generate output text. I think this is possible, but if it's not going to work, then there's no need to go any further. (I could call Date.Now.ToString() and get the expected result. I haven't tried anything much more complicated yet)
I am in a Silverlight App, and so I can't add a reference to the project for the PluralizationServices library in the place where I need the generated .cs file. I was planning on just moving the .tt file to a non-SL app, using the namespace and moving the generated file to the correct space. Haven't got that far yet, so I don't know how much trouble that will be, but it doesn't seem like it should be too hard.
My current problem is that when I import the namespace of the library, I get an "ErrorGeneratingOutput" and I haven't been able to move on past that yet.
I am having a hard time finding information about how the import command works, so I assume that it's just obvious. At the same time though, this one doesn't work so I wonder if it might be an exception to the standard.
<##import namespace="System.Data.Entity.Design.PluralizationServices" #>
I have no idea why adding this line (and only this line) causes everything to break. I haven't even started to try to use it yet! Is there something somewhere about libraries in T4 that I should know or read? Thanks!
Here a description of how the import directive works. Without knowing the actual error T4 reports when transofrming the template in your environment, I can only guess that you didn't add an assembly directive to reference the System.Data.Entity.Design assembly. If this doesn't work, look at the errors reported by T4 in the Error List of visual studio, which should be more helpful than "ErrorGeneratingOutput".

Resources