Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate C# automatic properties with Codedom

is there a way Generate C# automatic properties with Codedom or maybe an other set of libreries that i can use ?

like image 415
Hannoun Yassir Avatar asked Jan 23 '10 10:01

Hannoun Yassir


People also ask

What is C Code generation?

Code generation from the Wolfram Language involves converting programs written in the Wolfram Language into other languages and then supporting them so that they can be executed. The Wolfram System compiler provides a system for code generation into the C language.

Can MATLAB generate C Code?

MATLAB Coder generates readable and portable C code from your MATLAB algorithms. This automated approach speeds up your design workflow and eliminates coding errors introduced by a manual translation process.

Can Simulink generate C Code?

Simulink® Coder™ generates standalone C and C++ code from Simulink models for deployment in a wide variety of applications. For a list of DSP System Toolbox™ features supported by Simulink Coder, see Blocks Supported for C Code Generation.

What is MATLAB TargetLink?

TargetLink is a software for automatic code generation, based on a subset of Simulink/Stateflow models, produced by dSPACE GmbH. TargetLink requires an existing MATLAB/Simulink model to work on. TargetLink generates both ANSI-C and production code optimized for specific processors.


2 Answers

No, it's not: C# CodeDom Automatic Property

Take a look into this article to get some useful examples

like image 134
Rubens Farias Avatar answered Sep 25 '22 12:09

Rubens Farias


You can use CodeSnippetTypeMember class for that purpose.

For example:

    CodeTypeDeclaration newType = new CodeTypeDeclaration("TestType");
    CodeSnippetTypeMember snippet = new CodeSnippetTypeMember();
    snippet.Comments.Add(new CodeCommentStatement("this is integer property", true));
    snippet.Text="public int IntergerProperty { get; set; }";
    newType.Members.Add(snippet);
like image 25
bigkahunaburger Avatar answered Sep 25 '22 12:09

bigkahunaburger