Setting C# in Astah

Astah Professional and UML support modeling in Java, C++, and C#.
If you are modeling in C#, set so in Astah first.

  1. Select a root package on a tree and check [C#] in the bottom pane.
    set-project-language-to-csharp

  2. Setting this as C# will enable you to C#-specific attributes for Classes, Attributes, and Operations in the [Language] tab.
    C#-specific options

Import C# source code

You can import C# source code by using this C# Reverse Plug-in (free).

section divider

Export C# source code

Astah can generate C# Skeleton Code from selected Diagram Elements.
The Definitions of Classes and Operations are exported as Documentation Comments.

1. Go to [Tools] – [C#] – [Export C#] in the Main Menu.
Export C-sharp menu

2. Select the target folder, target classes from which .cs files are to be generated by moving them from “Candidate List” to “Selected List”, then click [OK]. Make sure you choose the correct charset.
Export-CSharp-option

3. The source code files would be generated.
If there are source code files that have the same name, the source code files would be completely replaced with what you last export.
If you do not want the latest export to overwrite the whole source code and you want to keep any modifications you’ve made to the .java files, check [When overwriting, keep the information of existing code that is not in the model.] option.
Csharp-no-overwritting-option