mirror of
https://github.com/dgis/xsddiagram.git
synced 2024-10-26 18:49:35 +03:00
- The error dialog should now appear if a local dependency cannot be loaded.
- Fix the "use" field of an attribute with a reference (Thanks Christelle S.).
This commit is contained in:
parent
ad920317b9
commit
81a4b39e74
14
MainForm.cs
14
MainForm.cs
@ -826,7 +826,7 @@ namespace XSDDiagram
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseAttribute(string nameSpace, List<XSDAttribute> listAttributes, XMLSchema.attribute attribute, bool isRestriction)
|
||||
private XSDAttribute ParseAttribute(string nameSpace, List<XSDAttribute> listAttributes, XMLSchema.attribute attribute, bool isRestriction)
|
||||
{
|
||||
bool isReference = false;
|
||||
string filename = "";
|
||||
@ -839,8 +839,13 @@ namespace XSDDiagram
|
||||
if (o is XSDAttribute)
|
||||
{
|
||||
XSDAttribute xsdAttributeInstance = o as XSDAttribute;
|
||||
ParseAttribute(nameSpace, listAttributes, xsdAttributeInstance.Tag, isRestriction);
|
||||
return;
|
||||
XSDAttribute refXSDAttribute = ParseAttribute(nameSpace, listAttributes, xsdAttributeInstance.Tag, isRestriction);
|
||||
if(refXSDAttribute != null)
|
||||
{
|
||||
// Override the "use" field with
|
||||
refXSDAttribute.Use = attribute.use.ToString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else // Reference not found!
|
||||
{
|
||||
@ -900,7 +905,10 @@ namespace XSDDiagram
|
||||
{
|
||||
XSDAttribute xsdAttribute = new XSDAttribute(filename, name, nameSpace, type, isReference, attribute.@default, attribute.use.ToString(), attribute);
|
||||
listAttributes.Insert(0, xsdAttribute);
|
||||
return xsdAttribute;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void ParseAttributeGroup(string nameSpace, List<XSDAttribute> listAttributes, XMLSchema.attributeGroup attributeGroup, bool isRestriction)
|
||||
|
@ -123,6 +123,8 @@ CHANGES:
|
||||
|
||||
version 1.1 (Not released yet)
|
||||
- Fix SVG page size.
|
||||
- The error dialog should now appear if a local dependency cannot be loaded.
|
||||
- Fix the "use" field of an attribute with a reference (Thanks Christelle S.).
|
||||
|
||||
version 1.0 (2016-02-28)
|
||||
- Add the documentation in the diagram.
|
||||
|
@ -121,7 +121,15 @@ namespace XSDDiagram
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
this.loadError.Add(ex.Message + "\r\n" + ex.InnerException.Message);
|
||||
this.loadError.Add(ex.Message + "\r\n" + (ex.InnerException != null ? ex.InnerException.Message : ex.Message));
|
||||
}
|
||||
catch (UriFormatException ex)
|
||||
{
|
||||
this.loadError.Add(ex.Message + "\r\n" + (ex.InnerException != null ? ex.InnerException.Message : ex.Message));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.loadError.Add(ex.Message + "\r\n" + (ex.InnerException != null ? ex.InnerException.Message : ex.Message));
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -247,7 +255,15 @@ namespace XSDDiagram
|
||||
{
|
||||
loadedFilename = null;
|
||||
baseUrl = "";
|
||||
Uri uri = new Uri(url);
|
||||
Uri uri;
|
||||
try
|
||||
{
|
||||
uri = new Uri(url);
|
||||
}
|
||||
catch (UriFormatException ex)
|
||||
{
|
||||
throw new Exception("Cannot read the URL '" + url + "'!");
|
||||
}
|
||||
if (uri.Segments.Length > 0)
|
||||
{
|
||||
string fileNameToImport = uri.Segments[uri.Segments.Length - 1];
|
||||
|
Loading…
Reference in New Issue
Block a user