1
1
mirror of https://github.com/dgis/xsddiagram.git synced 2024-08-17 06:20:23 +03:00

add: type to diagram

This commit is contained in:
EIDMANN Andreas 2017-05-24 14:46:33 +02:00
parent 56756c7e53
commit 22466990a8
2 changed files with 22 additions and 1 deletions

View File

@ -492,7 +492,10 @@ namespace XSDDiagram.Rendering
stringFormatText.Alignment = StringAlignment.Center;
stringFormatText.LineAlignment = StringAlignment.Center;
stringFormatText.FormatFlags |= StringFormatFlags.NoClip; //MONOFIX
_graphics.DrawString(drawingItem.Name, drawingItem.FontScaled, foreground, new RectangleF(scaledElementBox.X, scaledElementBox.Y, scaledElementBox.Width, scaledElementBox.Height), stringFormatText);
string type = drawingItem.GetTypeAnnotation();
_graphics.DrawString(drawingItem.Name +" : "+type,drawingItem.FontScaled, foreground, new RectangleF(scaledElementBox.X, scaledElementBox.Y, scaledElementBox.Width, scaledElementBox.Height), stringFormatText);
}
// Draw Documentation

View File

@ -484,6 +484,24 @@ namespace XSDDiagram.Rendering
return _diagram.ScaleRectangle(rectangle);
}
public String GetTypeAnnotation()
{
string text = null;
XMLSchema.element element = this.TabSchema as XMLSchema.element;
if (element != null)
{
String t = "" + element.type;
int idx = t.LastIndexOf(':');
return t.Substring(idx + 1);
}
return text;
}
public string GetTextDocumentation()
{
string text = null;