1
1
mirror of https://github.com/dgis/xsddiagram.git synced 2024-07-14 22:00:33 +03:00

- Add the type in the diagram with all occurences with a compact layout (from Andreas Eidmann https://github.com/dgis/xsddiagram/pull/14)

- Add a new settings windows with the options to show the type in the diagram, to show all the occurences, and to a compact layout.
This commit is contained in:
dgis 2019-11-08 23:16:34 +01:00
parent 154f9ed144
commit 426844bdb1
16 changed files with 646 additions and 85 deletions

59
MainForm.Designer.cs generated
View File

@ -32,6 +32,8 @@ namespace XSDDiagram
this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.windowsExplorerRegistrationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -156,6 +158,8 @@ namespace XSDDiagram
this.printPreviewToolStripMenuItem,
this.printToolStripMenuItem,
this.toolStripMenuItem1,
this.settingsToolStripMenuItem,
this.toolStripMenuItem5,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
@ -166,7 +170,7 @@ namespace XSDDiagram
this.openToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Open;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.openToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.openToolStripMenuItem.Text = "&Open...";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
@ -175,15 +179,15 @@ namespace XSDDiagram
this.openURLToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Open;
this.openURLToolStripMenuItem.Name = "openURLToolStripMenuItem";
this.openURLToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
this.openURLToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.openURLToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.openURLToolStripMenuItem.Text = "Open &URL...";
this.openURLToolStripMenuItem.Click += new System.EventHandler(this.openURLToolStripMenuItem_Click);
//
// inferXSDFromXMLToolStripMenuItem
//
this.inferXSDFromXMLToolStripMenuItem.Name = "inferXSDFromXMLToolStripMenuItem";
this.inferXSDFromXMLToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.inferXSDFromXMLToolStripMenuItem.Text = "Infer XSD from XML...";
this.inferXSDFromXMLToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.inferXSDFromXMLToolStripMenuItem.Text = "Infer XSD from &XML...";
this.inferXSDFromXMLToolStripMenuItem.Click += new System.EventHandler(this.inferXSDFromXMLToolStripMenuItem_Click);
//
// saveDiagramToolStripMenuItem
@ -191,14 +195,14 @@ namespace XSDDiagram
this.saveDiagramToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.SaveGreen;
this.saveDiagramToolStripMenuItem.Name = "saveDiagramToolStripMenuItem";
this.saveDiagramToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.saveDiagramToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.saveDiagramToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.saveDiagramToolStripMenuItem.Text = "&Export Diagram...";
this.saveDiagramToolStripMenuItem.Click += new System.EventHandler(this.saveDiagramToolStripMenuItem_Click);
//
// generateSampleToolStripMenuItem
//
this.generateSampleToolStripMenuItem.Name = "generateSampleToolStripMenuItem";
this.generateSampleToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.generateSampleToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.generateSampleToolStripMenuItem.Text = "&Generate Sample...";
this.generateSampleToolStripMenuItem.Visible = false;
this.generateSampleToolStripMenuItem.Click += new System.EventHandler(this.generateSampleToolStripMenuItem_Click);
@ -206,32 +210,32 @@ namespace XSDDiagram
// validateXMLFileToolStripMenuItem
//
this.validateXMLFileToolStripMenuItem.Name = "validateXMLFileToolStripMenuItem";
this.validateXMLFileToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.validateXMLFileToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.validateXMLFileToolStripMenuItem.Text = "&Validate XML File...";
this.validateXMLFileToolStripMenuItem.Click += new System.EventHandler(this.validateXMLFileToolStripMenuItem_Click);
//
// recentFilesToolStripMenuItem
//
this.recentFilesToolStripMenuItem.Name = "recentFilesToolStripMenuItem";
this.recentFilesToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.recentFilesToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.recentFilesToolStripMenuItem.Text = "&Recent Files";
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.closeToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.closeToolStripMenuItem.Text = "&Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(201, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(202, 6);
//
// pageToolStripMenuItem
//
this.pageToolStripMenuItem.Name = "pageToolStripMenuItem";
this.pageToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.pageToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.pageToolStripMenuItem.Text = "Page Set&up...";
this.pageToolStripMenuItem.Click += new System.EventHandler(this.pageToolStripMenuItem_Click);
//
@ -239,7 +243,7 @@ namespace XSDDiagram
//
this.printPreviewToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.PrintPreview;
this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.printPreviewToolStripMenuItem.Text = "Print Pre&view...";
this.printPreviewToolStripMenuItem.Click += new System.EventHandler(this.printPreviewToolStripMenuItem_Click);
//
@ -248,20 +252,32 @@ namespace XSDDiagram
this.printToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Print;
this.printToolStripMenuItem.Name = "printToolStripMenuItem";
this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.printToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.printToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.printToolStripMenuItem.Text = "&Print...";
this.printToolStripMenuItem.Click += new System.EventHandler(this.printToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(201, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(202, 6);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.settingsToolStripMenuItem.Text = "Se&ttings...";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(202, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.exitToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
@ -270,7 +286,7 @@ namespace XSDDiagram
this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.windowsExplorerRegistrationToolStripMenuItem});
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
this.toolsToolStripMenuItem.Text = "&Tools";
//
// windowsExplorerRegistrationToolStripMenuItem
@ -280,7 +296,7 @@ namespace XSDDiagram
this.unregisterToolStripMenuItem});
this.windowsExplorerRegistrationToolStripMenuItem.Image = global::XSDDiagram.Properties.Resources.Properties;
this.windowsExplorerRegistrationToolStripMenuItem.Name = "windowsExplorerRegistrationToolStripMenuItem";
this.windowsExplorerRegistrationToolStripMenuItem.Size = new System.Drawing.Size(262, 22);
this.windowsExplorerRegistrationToolStripMenuItem.Size = new System.Drawing.Size(264, 22);
this.windowsExplorerRegistrationToolStripMenuItem.Text = "&Windows Explorer Contextual Menu";
//
// registerToolStripMenuItem
@ -312,7 +328,7 @@ namespace XSDDiagram
//
this.nextTabToolStripMenuItem.Name = "nextTabToolStripMenuItem";
this.nextTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Tab)));
this.nextTabToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
this.nextTabToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.nextTabToolStripMenuItem.Text = "&Next Tab";
this.nextTabToolStripMenuItem.Click += new System.EventHandler(this.nextTabToolStripMenuItem_Click);
//
@ -321,7 +337,7 @@ namespace XSDDiagram
this.previousTabToolStripMenuItem.Name = "previousTabToolStripMenuItem";
this.previousTabToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.Tab)));
this.previousTabToolStripMenuItem.Size = new System.Drawing.Size(240, 22);
this.previousTabToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
this.previousTabToolStripMenuItem.Text = "&Previous Tab";
this.previousTabToolStripMenuItem.Click += new System.EventHandler(this.previousTabToolStripMenuItem_Click);
//
@ -718,6 +734,7 @@ namespace XSDDiagram
this.listViewAttributes.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewAttributes.FullRowSelect = true;
this.listViewAttributes.GridLines = true;
this.listViewAttributes.HideSelection = false;
this.listViewAttributes.LabelEdit = true;
this.listViewAttributes.Location = new System.Drawing.Point(3, 3);
this.listViewAttributes.MultiSelect = false;
@ -811,6 +828,7 @@ namespace XSDDiagram
this.listViewEnumerate.Dock = System.Windows.Forms.DockStyle.Bottom;
this.listViewEnumerate.FullRowSelect = true;
this.listViewEnumerate.GridLines = true;
this.listViewEnumerate.HideSelection = false;
this.listViewEnumerate.Location = new System.Drawing.Point(0, 313);
this.listViewEnumerate.Name = "listViewEnumerate";
this.listViewEnumerate.Size = new System.Drawing.Size(214, 91);
@ -1032,6 +1050,7 @@ namespace XSDDiagram
this.MainMenuStrip = this.menuStripMain;
this.Name = "MainForm";
this.Text = "XSD Diagram";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
this.Load += new System.EventHandler(this.MainForm_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.MainForm_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.MainForm_DragEnter);
@ -1156,6 +1175,8 @@ namespace XSDDiagram
private System.Windows.Forms.ToolStripButton toolStripButtonSearch;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripTextBox toolStripTextBoxSearch;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5;
}
}

View File

@ -19,29 +19,22 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Security.Principal;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;
// To generate the XMLSchema.cs file:
// > xsd.exe XMLSchema.xsd /classes /l:cs /n:XMLSchema /order
using XSDDiagram.Rendering;
using System.Xml.Schema;
using System.Diagnostics;
using System.Security.Principal;
namespace XSDDiagram
{
public partial class MainForm : Form
public partial class MainForm : Form
{
private DiagramPrinter _diagramPrinter;
private DiagramGdiRenderer _diagramGdiRenderer;
@ -61,9 +54,15 @@ namespace XSDDiagram
private MRUManager mruManager;
private static MainForm mainForm = null;
public static MainForm Form { get { return mainForm; } }
public MainForm()
{
InitializeComponent();
mainForm = this;
InitializeComponent();
bool isElevated = false;
WindowsIdentity identity = null;
@ -89,7 +88,11 @@ namespace XSDDiagram
identity.Dispose();
}
this.toolsToolStripMenuItem.Visible = isElevated && !Options.IsRunningOnMono;
this.diagram.ShowDocumentation = this.toolStripButtonShowDocumentation.Checked = Options.ShowDocumentation;
this.diagram.ShowDocumentation = this.toolStripButtonShowDocumentation.Checked = Options.ShowDocumentation | Settings.Default.ShowDocumentation;
this.diagram.AlwaysShowOccurence = Settings.Default.AlwaysShowOccurence;
this.diagram.ShowType = Settings.Default.ShowType;
this.diagram.CompactLayoutDensity = Settings.Default.CompactLayoutDensity;
this.originalTitle = Text;
@ -178,10 +181,15 @@ namespace XSDDiagram
this.mruManager = new MRUManager(this.recentFilesToolStripMenuItem, "xsddiagram", this.recentFilesToolStripMenuSubItemFile_Click, this.recentFilesToolStripMenuSubItemClearAll_Click);
this.toolStripComboBoxZoom.SelectedIndex = 8;
this.toolStripComboBoxAlignement.SelectedIndex = 1;
this.toolStripComboBoxZoom.SelectedIndex = Settings.Default.Zoom; // 8;
this.toolStripComboBoxAlignement.SelectedIndex = Settings.Default.Alignement; // 1;
if (!string.IsNullOrEmpty(Options.InputFile))
this.toolStripButtonTogglePanel.Checked = Settings.Default.DisplayPanel;
this.splitContainerMain.Panel2Collapsed = !this.toolStripButtonTogglePanel.Checked;
if (!string.IsNullOrEmpty(Options.InputFile))
{
LoadSchema(Options.InputFile);
foreach (var rootElement in Options.RootElements)
@ -317,15 +325,55 @@ namespace XSDDiagram
return MessageBox.Show(this, message, title, MessageBoxButtons.YesNo) == DialogResult.Yes;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
SettingsForm settingsForm;
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (settingsForm == null) {
settingsForm = new SettingsForm();
settingsForm.FormClosed += SettingsForm_FormClosed;
settingsForm.Show(this);
}
settingsForm.Focus();
}
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
{
settingsForm.FormClosed -= SettingsForm_FormClosed;
settingsForm = null;
}
internal void ChangeSetting(string settingName)
{
switch (settingName)
{
case "AlwaysShowOccurence":
this.diagram.AlwaysShowOccurence = Settings.Default.AlwaysShowOccurence;
UpdateDiagram();
break;
case "ShowType":
this.diagram.ShowType = Settings.Default.ShowType;
UpdateDiagram();
break;
case "CompactLayoutDensity":
this.diagram.CompactLayoutDensity = Settings.Default.CompactLayoutDensity;
UpdateDiagram();
break;
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
{
Settings.Default.Save();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
AboutForm aboutForm = new AboutForm();
aboutForm.ShowDialog(this);
new AboutForm().ShowDialog(this);
}
private void toolStripComboBoxSchemaElement_SelectedIndexChanged(object sender, EventArgs e)
@ -884,9 +932,11 @@ namespace XSDDiagram
}
}
catch { }
}
private void toolStripComboBoxZoom_TextChanged(object sender, EventArgs e)
Settings.Default.Zoom = this.toolStripComboBoxZoom.SelectedIndex;
}
private void toolStripComboBoxZoom_TextChanged(object sender, EventArgs e)
{
//try
//{
@ -977,9 +1027,11 @@ namespace XSDDiagram
private void toolStripButtonTogglePanel_Click(object sender, EventArgs e)
{
this.splitContainerMain.Panel2Collapsed = !this.toolStripButtonTogglePanel.Checked;
}
private void contextMenuStripDiagram_Opened(object sender, EventArgs e)
Settings.Default.DisplayPanel = this.toolStripButtonTogglePanel.Checked;
}
private void contextMenuStripDiagram_Opened(object sender, EventArgs e)
{
this.gotoXSDFileToolStripMenuItem.Enabled = false;
this.expandToolStripMenuItem.Enabled = false;
@ -1142,9 +1194,11 @@ namespace XSDDiagram
case "Bottom": this.diagram.Alignement = DiagramAlignement.Far; break;
}
UpdateDiagram();
}
void diagram_RequestAnyElement(DiagramItem diagramElement, out XMLSchema.element element, out string nameSpace)
Settings.Default.Alignement = this.toolStripComboBoxAlignement.SelectedIndex;
}
void diagram_RequestAnyElement(DiagramItem diagramElement, out XMLSchema.element element, out string nameSpace)
{
element = null;
nameSpace = "";
@ -1687,6 +1741,8 @@ namespace XSDDiagram
{
this.diagram.ShowDocumentation = this.toolStripButtonShowDocumentation.Checked;
UpdateDiagram();
Settings.Default.ShowDocumentation = this.toolStripButtonShowDocumentation.Checked;
}
private void toolStripButtonSearch_Click(object sender, EventArgs e)
@ -1720,7 +1776,6 @@ namespace XSDDiagram
}
}
private void MainForm_KeyUp(object sender, KeyEventArgs e)
{
if (e.Control && (e.KeyCode == Keys.D0 || e.KeyCode == Keys.NumPad0))

View File

@ -139,8 +139,10 @@ TODO LIST:
CHANGES:
version 1.3 (2019-10-XX)
version 1.3 (2019-11-XX)
- Add the fields SEQ,LASTCHILD,XSDTYPE when rendering to a txt or csv file (https://github.com/dgis/xsddiagram/issues/22).
- Add the type in the diagram with all occurences with a compact layout (from Andreas Eidmann https://github.com/dgis/xsddiagram/pull/14)
- Add a new settings windows with the options to show the type in the diagram, to show all the occurences, and to a compact layout.
version 1.2 (2018-06-19)
- Add infer XSD from XML menu.

122
Settings.cs Normal file
View File

@ -0,0 +1,122 @@
using System.ComponentModel;
namespace XSDDiagram {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[BrowsableAttribute(false)]
[Category("UI"), DisplayName("Display Right Panel"), Description("Display the right panel.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool DisplayPanel
{
get
{
return ((bool)(this["DisplayPanel"]));
}
set
{
this["DisplayPanel"] = value;
}
}
[BrowsableAttribute(false)]
[Category("Diagram"), DisplayName("Zoom"), Description("The zoom level.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8")]
public int Zoom
{
get
{
return ((int)(this["Zoom"]));
}
set
{
this["Zoom"] = value;
}
}
[BrowsableAttribute(false)]
[Category("Diagram"), DisplayName("Alignement"), Description("The item alignement.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public int Alignement {
get {
return ((int)(this["Alignement"]));
}
set {
this["Alignement"] = value;
}
}
[BrowsableAttribute(false)]
[Category("Diagram"), DisplayName("Show Documentation"), Description("Show the documentation under the item.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool ShowDocumentation {
get {
return ((bool)(this["ShowDocumentation"]));
}
set {
this["ShowDocumentation"] = value;
}
}
[Category("Diagram"), DisplayName("Always Show Occurence"), Description("Always show the occurence of an item even if it is different from 1..1.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AlwaysShowOccurence {
get {
return ((bool)(this["AlwaysShowOccurence"]));
}
set {
this["AlwaysShowOccurence"] = value;
}
}
[Category("Diagram"), DisplayName("Show Type"), Description("Show the type of an item if it exist.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool ShowType {
get {
return ((bool)(this["ShowType"]));
}
set {
this["ShowType"] = value;
}
}
[Category("Diagram"), DisplayName("CompactLayoutDensity"), Description("Display the diagram with a compact density.")]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool CompactLayoutDensity
{
get
{
return ((bool)(this["CompactLayoutDensity"]));
}
set
{
this["CompactLayoutDensity"] = value;
}
}
}
}

65
SettingsForm.Designer.cs generated Normal file
View File

@ -0,0 +1,65 @@
namespace XSDDiagram
{
partial class SettingsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsForm));
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// propertyGrid1
//
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid1.Location = new System.Drawing.Point(0, 0);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(517, 438);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.ToolbarVisible = false;
this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(517, 438);
this.Controls.Add(this.propertyGrid1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SettingsForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Settings";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.SettingsForm_FormClosed);
this.Load += new System.EventHandler(this.SettingsForm_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PropertyGrid propertyGrid1;
}
}

34
SettingsForm.cs Normal file
View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using XSDDiagram.Properties;
namespace XSDDiagram
{
public partial class SettingsForm : Form
{
public SettingsForm()
{
InitializeComponent();
}
private void SettingsForm_Load(object sender, EventArgs e)
{
this.propertyGrid1.SelectedObject = Settings.Default;
}
private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
{
this.propertyGrid1.SelectedObject = null;
}
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
{
MainForm.Form.ChangeSetting(e.ChangedItem.PropertyDescriptor.Name);
}
}
}

197
SettingsForm.resx Normal file
View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AO8AAAD/AAAA/wAAAP8AAAD/AAAA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAA/5T/AP+U/wD/lP8A/5T/AP8AAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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DQ
//8A0P//AND//wAAAAAAAAAAAAAAAADQ/yAA0P//AND//wDQ//8A0P8gAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQ/0AA0P//AND//wA0QP8AAAD/AAAAQAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAND/QADQ//8A0P//AND/QAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA////////////4f///8D///8A////QP///2H//8N///+Bf/wfgH/4D4Fg
YA/DQCwf/wAP///ALB//4GAP///4D//////nxB8TkwBsQ8EXoMPAH4DD5D4Aw/A4MMPwcPLD8DJyQ/AZ
AQPgHBwDwk//w8MH/8OPH//D////z/////8=
</value>
</data>
</root>

Binary file not shown.

View File

@ -134,6 +134,13 @@
<Compile Include="Options.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AboutForm.resx">
<SubType>Designer</SubType>
<DependentUpon>AboutForm.cs</DependentUpon>
@ -173,6 +180,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

Binary file not shown.

View File

@ -23,6 +23,9 @@ namespace XSDDiagram.Rendering
private bool _showBoundingBox;
private bool _showDocumentation;
private bool _alwaysShowOccurence;
private bool _showType;
private bool _compactLayoutDensity;
private Size _size;
private Size _padding;
private float _scale;
@ -65,7 +68,6 @@ namespace XSDDiagram.Rendering
_lastSearchText = String.Empty;
_lastSearchHitElementIndex = 0;
_lastSearchHitElements = new List<DiagramItem>();
}
#endregion
@ -79,6 +81,9 @@ namespace XSDDiagram.Rendering
public DiagramAlignement Alignement { get { return _alignement; } set { _alignement = value; } }
public bool ShowBoundingBox { get { return _showBoundingBox; } set { _showBoundingBox = value; } }
public bool ShowDocumentation { get { return _showDocumentation; } set { _showDocumentation = value; } }
public bool AlwaysShowOccurence { get { return _alwaysShowOccurence; } set { _alwaysShowOccurence = value; } }
public bool ShowType { get { return _showType; } set { _showType = value; } }
public bool CompactLayoutDensity { get { return _compactLayoutDensity; } set { _compactLayoutDensity = value; } }
public Font Font { get { return _font; } set { _font = value; } }
public Font FontScaled { get { return _fontScaled; } set { _fontScaled = value; } }
@ -155,10 +160,12 @@ namespace XSDDiagram.Rendering
childDiagramElement.Diagram = this;
childDiagramElement.TabSchema = childElement;
childDiagramElement.Name = childElement.name != null ? childElement.name : "";
childDiagramElement.NameSpace = nameSpace;
string type = childDiagramElement.GetTypeAnnotation();
childDiagramElement.Name = childElement.name != null ? childElement.name + "::" + type : "";
childDiagramElement.NameSpace = nameSpace;
childDiagramElement.ItemType = DiagramItemType.element;
if (!String.IsNullOrEmpty(type))
childDiagramElement.Type = type;
childDiagramElement.ItemType = DiagramItemType.element;
int occurrence;
if (int.TryParse(referenceElement != null ? referenceElement.minOccurs : childElement.minOccurs, out occurrence))
childDiagramElement.MinOccurrence = occurrence;
@ -240,7 +247,6 @@ namespace XSDDiagram.Rendering
DiagramItem childDiagramElement = new DiagramItem();
childDiagramElement.Diagram = this;
childDiagramElement.TabSchema = childElement;
childDiagramElement.Name = childElement.name != null ? childElement.name : "";
childDiagramElement.NameSpace = nameSpace;
childDiagramElement.ItemType = DiagramItemType.type;

View File

@ -12,9 +12,7 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Text.RegularExpressions;
namespace XSDDiagram.Rendering
{
@ -492,8 +490,7 @@ 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);
_graphics.DrawString(drawingItem.Diagram.ShowType && !string.IsNullOrEmpty(drawingItem.Type) ? drawingItem.Name + ":" + drawingItem.Type : drawingItem.Name, drawingItem.FontScaled, foreground, new RectangleF(scaledElementBox.X, scaledElementBox.Y, scaledElementBox.Width, scaledElementBox.Height), stringFormatText);
}
// Draw Documentation
@ -522,7 +519,7 @@ namespace XSDDiagram.Rendering
}
// Draw occurences small text
// if (drawingItem.MaxOccurrence > 1 || drawingItem.MaxOccurrence == -1)
if (drawingItem.Diagram.AlwaysShowOccurence || (drawingItem.MaxOccurrence > 1 || drawingItem.MaxOccurrence == -1))
{
StringFormat stringFormatOccurences = new StringFormat();
stringFormatOccurences.Alignment = StringAlignment.Far;
@ -531,8 +528,9 @@ namespace XSDDiagram.Rendering
//string occurences = string.Format("{0}..", drawingItem.MinOccurrence) + (drawingItem.MaxOccurrence == -1 ? "\u0066∞" : string.Format("{0}", drawingItem.MaxOccurrence));
string occurences = string.Format("{0}..", drawingItem.MinOccurrence) + (drawingItem.MaxOccurrence == -1 ? "\u221E" : string.Format("{0}", drawingItem.MaxOccurrence));
PointF pointOccurences = new PointF();
pointOccurences.X = drawingItem.Diagram.Scale * (drawingItem.Location.X + drawingItem.Size.Width + 20);
pointOccurences.Y = drawingItem.Diagram.Scale * (drawingItem.Location.Y + drawingItem.Size.Height - 17 );
bool compactLayoutDensity = drawingItem.Diagram.CompactLayoutDensity;
pointOccurences.X = drawingItem.Diagram.Scale * (drawingItem.Location.X + drawingItem.Size.Width + (compactLayoutDensity ? +20 : -10));
pointOccurences.Y = drawingItem.Diagram.Scale * (drawingItem.Location.Y + drawingItem.Size.Height + (compactLayoutDensity ? -17 : +10));
_graphics.DrawString(occurences, drawingItem.SmallFontScaled, foreground, pointOccurences, stringFormatOccurences);
}

View File

@ -13,8 +13,6 @@
using System;
using System.Drawing;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
namespace XSDDiagram.Rendering
{
@ -37,10 +35,12 @@ namespace XSDDiagram.Rendering
private Size _size;
private Size _margin;
private Size _padding;
private Size _paddingCompact;
private Point _location;
private string _name;
private string _nameSpace;
private string _type;
private Rectangle _elementBox;
private Rectangle _childExpandButtonBox;
@ -66,6 +66,7 @@ namespace XSDDiagram.Rendering
{
_name = String.Empty;
_nameSpace = String.Empty;
_type = String.Empty;
_minOccurrence = -1;
_maxOccurrence = -1;
_location = new Point(0, 0);
@ -78,7 +79,8 @@ namespace XSDDiagram.Rendering
_documentationMinWidth = 100;
_size = new Size(100, 25);
_margin = new Size(10, 5);
_padding = new Size(10, 2);
_padding = new Size(10, 15);
_paddingCompact = new Size(10, 4);
_itemType = DiagramItemType.element;
_childElements = new List<DiagramItem>();
}
@ -146,7 +148,19 @@ namespace XSDDiagram.Rendering
_nameSpace = value;
}
}
public string Type
{
get
{
return _type;
}
set
{
_type = value;
}
}
public DiagramItemType ItemType
{
get
@ -372,6 +386,18 @@ namespace XSDDiagram.Rendering
}
}
public Size PaddingCompact
{
get
{
return _paddingCompact;
}
set
{
_paddingCompact = value;
}
}
public Rectangle ElementBox
{
get
@ -543,19 +569,17 @@ namespace XSDDiagram.Rendering
public void GenerateMeasure(Graphics g)
{
Size padding = Diagram.CompactLayoutDensity ? _paddingCompact : _padding;
if (_parent != null)
_depth = _parent.Depth + 1;
if (_itemType == DiagramItemType.group)
{
_size = new Size(40, 20);
}
//else
// size = new Size(50, 25);
if (_name.Length > 0)
{
SizeF sizeF = g.MeasureString(_name, Font);
SizeF sizeF = g.MeasureString(Diagram.ShowType && !string.IsNullOrEmpty(_type) ? _name + ":" + _type : _name, Font);
//MONOFIX size = sizeF.ToSize();
_size = new Size((int)sizeF.Width, (int)sizeF.Height);
_size = _size + new Size(2 * Margin.Width + (_hasChildElements ? ChildExpandButtonSize : 0), 2 * Margin.Height);
@ -574,8 +598,8 @@ namespace XSDDiagram.Rendering
childBoundingBoxHeight += element.BoundingBox.Size.Height;
}
}
_boundingBox.Width = _size.Width + 2 * _padding.Width + childBoundingBoxWidth;
_boundingBox.Height = Math.Max(_size.Height + 2 * _padding.Height, childBoundingBoxHeight);
_boundingBox.Width = _size.Width + 2 * padding.Width + childBoundingBoxWidth;
_boundingBox.Height = Math.Max(_size.Height + 2 * padding.Height, childBoundingBoxHeight);
if (_diagram.ShowDocumentation)
{
@ -590,10 +614,10 @@ namespace XSDDiagram.Rendering
}
SizeF sizeF = g.MeasureString(text, DocumentationFont);
double documentationWidth = Math.Max(1.0, _size.Width + _padding.Width); // * 2.0);
double documentationWidth = Math.Max(1.0, _size.Width + padding.Width); // * 2.0);
double documentationHeight = (Math.Ceiling(sizeF.Width / documentationWidth) + 1.8) * sizeF.Height;
_documentationBox = new Rectangle(new Point(0, 0), new Size((int)documentationWidth, (int)documentationHeight));
_boundingBox.Height = Math.Max(_size.Height + 2 * _padding.Height + _documentationBox.Height + 2 * _padding.Height, childBoundingBoxHeight);
_boundingBox.Height = Math.Max(_size.Height + 2 * padding.Height + _documentationBox.Height + 2 * padding.Height, childBoundingBoxHeight);
}
}
@ -610,7 +634,8 @@ namespace XSDDiagram.Rendering
public void GenerateLocation()
{
_location.X = _boundingBox.X + _padding.Width;
Size padding = Diagram.CompactLayoutDensity ? _paddingCompact : _padding;
_location.X = _boundingBox.X + padding.Width;
switch (_diagram.Alignement)
{
@ -620,21 +645,21 @@ namespace XSDDiagram.Rendering
if(_diagram.ShowDocumentation && !_documentationBox.IsEmpty)
{
_location.Y = _boundingBox.Y +
(_boundingBox.Height - (2 * _padding.Height + _documentationBox.Height)) / 2;
(_boundingBox.Height - (2 * padding.Height + _documentationBox.Height)) / 2;
}
break;
case DiagramAlignement.Near:
if (_itemType == DiagramItemType.group && _parent != null && _parent.ChildElements.Count == 1)
_location.Y = _parent.Location.Y + (_parent._elementBox.Height - _elementBox.Height) / 2;
else
_location.Y = _boundingBox.Y + _padding.Height;
_location.Y = _boundingBox.Y + padding.Height;
break;
case DiagramAlignement.Far:
if (_itemType == DiagramItemType.group && _parent != null && _parent.ChildElements.Count == 1)
_location.Y = _parent.Location.Y + (_parent._elementBox.Height - _elementBox.Height) / 2;
else
_location.Y = _boundingBox.Y +
_boundingBox.Height - _size.Height - _padding.Height;
_boundingBox.Height - _size.Height - padding.Height;
break;
}
@ -644,7 +669,7 @@ namespace XSDDiagram.Rendering
foreach (DiagramItem element in _childElements)
childrenHeight += element.BoundingBox.Height;
int childrenX = _boundingBox.X + 2 * _padding.Width + Size.Width;
int childrenX = _boundingBox.X + 2 * padding.Width + Size.Width;
int childrenY = _boundingBox.Y + Math.Max(0, (_boundingBox.Height - childrenHeight) / 2);
foreach (DiagramItem element in _childElements)
@ -667,9 +692,9 @@ namespace XSDDiagram.Rendering
if (!_documentationBox.IsEmpty)
{
if(_diagram.Alignement == DiagramAlignement.Far)
_documentationBox.Offset(_location.X, _location.Y - _documentationBox.Height - _padding.Height);
_documentationBox.Offset(_location.X, _location.Y - _documentationBox.Height - padding.Height);
else
_documentationBox.Offset(_location.X, _location.Y + _elementBox.Height + _padding.Height);
_documentationBox.Offset(_location.X, _location.Y + _elementBox.Height + padding.Height);
}
}

View File

@ -483,7 +483,7 @@ namespace XSDDiagram.Rendering
string style = String.Format(
"font-family:{0};font-size:{1}pt;fill:{2};font-weight:bold;text-anchor:middle;dominant-baseline:central",
drawingItem.Font.Name, drawingItem.Font.Size * fontScale, foregroundColor);
SVGText(drawingItem.Name, style,
SVGText(drawingItem.Diagram.ShowType && !string.IsNullOrEmpty(drawingItem.Type) ? drawingItem.Name + ":" + drawingItem.Type : drawingItem.Name, style,
new Rectangle(scaledElementBox.X, scaledElementBox.Y, scaledElementBox.Width, scaledElementBox.Height));
}
@ -507,13 +507,14 @@ namespace XSDDiagram.Rendering
}
// Draw occurences small text
// if (drawingItem.MaxOccurrence > 1 || drawingItem.MaxOccurrence == -1)
if (drawingItem.Diagram.AlwaysShowOccurence || (drawingItem.MaxOccurrence > 1 || drawingItem.MaxOccurrence == -1))
{
string occurences = String.Format("{0}..", drawingItem.MinOccurrence) +
(drawingItem.MaxOccurrence == -1 ? "∞" : string.Format("{0}", drawingItem.MaxOccurrence));
PointF pointOccurences = new PointF();
pointOccurences.X = drawingItem.Diagram.Scale * (drawingItem.Location.X + drawingItem.Size.Width + 20);
pointOccurences.Y = drawingItem.Diagram.Scale * (drawingItem.Location.Y + drawingItem.Size.Height - 17);
bool compactLayoutDensity = drawingItem.Diagram.CompactLayoutDensity;
pointOccurences.X = drawingItem.Diagram.Scale * (drawingItem.Location.X + drawingItem.Size.Width + (compactLayoutDensity ? +20 : -10));
pointOccurences.Y = drawingItem.Diagram.Scale * (drawingItem.Location.Y + drawingItem.Size.Height + (compactLayoutDensity ? -17 : +10));
string style = String.Format(
"font-family:{0};font-size:{1}pt;fill:{2};text-anchor:end;dominant-baseline:central",
drawingItem.SmallFont.Name, drawingItem.SmallFont.Size * fontScale, foregroundColor);

View File

@ -12,8 +12,6 @@
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Collections.Generic;

View File

@ -1,3 +1,30 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="XSDDiagram.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup><supportedRuntime version="v2.0.50727"/></startup><userSettings>
<XSDDiagram.Properties.Settings>
<setting name="Alignement" serializeAs="String">
<value>1</value>
</setting>
<setting name="ShowDocumentation" serializeAs="String">
<value>False</value>
</setting>
<setting name="DisplayPanel" serializeAs="String">
<value>True</value>
</setting>
<setting name="AlwaysShowOccurence" serializeAs="String">
<value>False</value>
</setting>
<setting name="ShowType" serializeAs="String">
<value>False</value>
</setting>
<setting name="Zoom" serializeAs="String">
<value>8</value>
</setting>
</XSDDiagram.Properties.Settings>
</userSettings>
</configuration>