-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from 8T4/feature/c4chapr-tools
Feature/c4chapr tools
- Loading branch information
Showing
34 changed files
with
391 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace C4Sharp.Diagrams | ||
{ | ||
public interface IDiagramStyle | ||
{ | ||
public IDictionary<string, string> Items { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace C4Sharp.Diagrams | ||
{ | ||
public interface IElementStyle: IDiagramStyle | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace C4Sharp.Diagrams | ||
{ | ||
public interface IElementTag: IDiagramStyle | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace C4Sharp.Diagrams | ||
{ | ||
public interface IRelationshipTag: IDiagramStyle | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.IO; | ||
using C4Sharp.Extensions; | ||
|
||
namespace C4Sharp.FileSystem | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace C4Sharp.Models.Plantuml.Constants | ||
{ | ||
public record ElementName | ||
{ | ||
public static ElementName Person => new() { Name = "person" }; | ||
public static ElementName ExternalPerson => new() { Name = "external_person"}; | ||
public static ElementName System => new() { Name = "system"}; | ||
public static ElementName ExternalSystem => new() { Name = "external_system"}; | ||
public static ElementName Component => new() { Name = "component"}; | ||
public static ElementName ExternalComponent => new() { Name = "external_component"}; | ||
public static ElementName Container => new() { Name = "container"}; | ||
public static ElementName ExternalContainer => new() { Name = "external_container"}; | ||
|
||
public string Name { get; private init; } = string.Empty; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace C4Sharp.Models.Plantuml.Constants | ||
{ | ||
public record LineStyle | ||
{ | ||
/// <summary> | ||
/// This call returns the name of the dashed line and can be used as ?lineStyle argument. | ||
/// </summary> | ||
public static LineStyle DashedLine => new() { Value = "DashedLine()" }; | ||
/// <summary> | ||
/// This call returns the name of the dotted line and can be used as ?lineStyle argument. | ||
/// </summary> | ||
public static LineStyle DottedLine => new() { Value = "DottedLine()"}; | ||
/// <summary> | ||
/// This call returns the name of the bold line and can be used as ?lineStyle argument. | ||
/// </summary> | ||
public static LineStyle BoldLine => new() { Value = "BoldLine()"}; | ||
|
||
public string Value { get; private init; } = string.Empty; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace C4Sharp.Models.Plantuml.Constants | ||
{ | ||
public record Shape | ||
{ | ||
/// <summary> | ||
/// This call returns the name of the rounded box shape and can be used as ?shape argument. | ||
/// </summary> | ||
public static Shape RoundedBoxShape => new() { Value = "RoundedBoxShape()" }; | ||
/// <summary> | ||
/// This call returns the name of the eight sided shape and can be used as ?shape argument. | ||
/// </summary> | ||
public static Shape EightSidedShape => new() { Value = "EightSidedShape()"}; | ||
|
||
public string Value { get; private init; } = string.Empty; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using C4Sharp.Diagrams; | ||
using C4Sharp.Models.Plantuml.Constants; | ||
|
||
namespace C4Sharp.Models.Plantuml | ||
{ | ||
public class ElementStyle: IElementStyle | ||
{ | ||
public IDictionary<string, string> Items { get; } | ||
|
||
public ElementStyle() | ||
{ | ||
Items = new Dictionary<string, string>(); | ||
} | ||
|
||
public ElementStyle UpdateElementStyle(ElementName elementName, string bgColor, string fontColor="#ffffff", string borderColor="#00000000", bool shadowing = false, Shape? shape = null) | ||
{ | ||
if (elementName is null) | ||
throw new ArgumentNullException(nameof(elementName), $"{nameof(elementName)} is required"); | ||
|
||
var value = shape is null | ||
? $"UpdateElementStyle(\"{elementName.Name}\", $bgColor={bgColor}, $fontColor={fontColor}, $borderColor={borderColor}, $shadowing=\"{shadowing}\")" | ||
: $"UpdateElementStyle(\"{elementName.Name}\", $bgColor={bgColor}, $fontColor={fontColor}, $borderColor={borderColor}, $shadowing=\"{shadowing}\", $shape={shape.Value})"; | ||
|
||
Items[elementName.Name] = value; | ||
return this; | ||
} | ||
} | ||
} |
Oops, something went wrong.