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:
parent
56756c7e53
commit
22466990a8
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user