-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd6e9a2
commit a560151
Showing
3 changed files
with
51 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
using System.Collections.Generic; | ||
using Lively.TypeDescriptions; | ||
|
||
namespace Lively.Diagrams | ||
{ | ||
public class FullNamePlantUml | ||
{ | ||
public static string Create(IList<DependencyTreeNode> nodes) | ||
public static string Create(IList<DependencyTreeNode> nodes, string[] namespaceMatches = null) | ||
{ | ||
var renderer = new PlantUmlRenderer(type => type.FullName); | ||
return renderer.Create(nodes); | ||
var renderer = new PlantUmlRenderer(type => | ||
{ | ||
if (namespaceMatches != null) | ||
{ | ||
foreach (var ns in namespaceMatches) | ||
{ | ||
if (type.FullName.StartsWith(ns + ".")) | ||
return OverrideNamespaceGrouping(ns, type.FullName); | ||
} | ||
} | ||
|
||
return type.FullName; | ||
}); | ||
return renderer.Create(nodes); | ||
} | ||
|
||
private static string OverrideNamespaceGrouping(string @namespace, string fullName) | ||
{ | ||
var end = fullName.Remove(0, @namespace.Length + 1); | ||
return $"{@namespace}.{end.Replace('.', '_').Replace('+', '_')}"; | ||
} | ||
} | ||
} |
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,5 +1,4 @@ | ||
using System.Collections.Generic; | ||
using Lively.TypeDescriptions; | ||
|
||
namespace Lively.Diagrams | ||
{ | ||
|