Skip to content

Commit

Permalink
Added Enum Constructor
Browse files Browse the repository at this point in the history
 - Added constructor for `Enum` using `UmlClass`
  • Loading branch information
tbm0115 committed Mar 31, 2023
1 parent fa88b45 commit eecbce5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions MtconnectTranspiler.Sinks.CSharp/Models/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ public Enum(XmiDocument model, UmlPackage source) : this(model, source, source.N
Summary = new Summary(source.Comments);
}

/// <summary>
/// <inheritdoc cref="Enum(XmiDocument, XmiElement, string)"/>
/// </summary>
/// <param name="model"><inheritdoc cref="Enum(XmiDocument, XmiElement, string)" path="/param[@name='model']"/></param>
/// <param name="source">The source <see cref="UmlClass"/> to convert into an <see cref="Enum"/></param>
public Enum(XmiDocument model, UmlClass source) : this(model, source, source.Name)
{
AddRange(model, source.Properties.ToList());

if (source.Comments?.Length > 0)
Summary = new Summary(source.Comments);
}

/// <summary>
/// Adds a <see cref="EnumItem"/>
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>MTConnect Transpiler Sink for C#</Title>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Authors>mtconnect, tbm0115</Authors>
<Company>MTConnect Institute; TAMS;</Company>
<Description>An implementation of `ITranspilerSink` from the `MtconnectTranspiler` library. This libary makes it possible to transpile the MTConnect Standard SysML model into C# code.</Description>
Expand Down

0 comments on commit eecbce5

Please sign in to comment.