-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'las-nsc-las/non-nullable-arrays'
- Loading branch information
Showing
4 changed files
with
789 additions
and
853 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System.Xml; | ||
using System.Xml.Schema; | ||
|
||
namespace XmlSchemaClassGenerator | ||
{ | ||
public interface IXmlSchemaNode | ||
{ | ||
//string Name { get; } | ||
string DefaultValue { get; } | ||
string FixedValue { get; } | ||
XmlSchemaForm Form { get; } | ||
XmlQualifiedName QualifiedName { get; } | ||
XmlQualifiedName RefName { get; } | ||
//XmlQualifiedName SchemaTypeName { get; } | ||
//XmlSchemaType SchemaType { get; } | ||
//XmlSchemaType NodeSchemaType { get; } | ||
|
||
XmlSchemaAnnotated Base { get; } | ||
XmlSchemaForm FormDefault { get; } | ||
} | ||
|
||
public sealed class XmlSchemaAttributeEx : IXmlSchemaNode | ||
{ | ||
private XmlSchemaAttributeEx(XmlSchemaAttribute xs) => Real = xs; | ||
|
||
public XmlSchemaAttribute Real { get; } | ||
|
||
//public string Name => Real.Name; | ||
public string DefaultValue => Real.DefaultValue; | ||
public string FixedValue => Real.FixedValue; | ||
public XmlSchemaForm Form => Real.Form; | ||
public XmlQualifiedName QualifiedName => Real.QualifiedName; | ||
public XmlQualifiedName RefName => Real.RefName; | ||
//public XmlQualifiedName SchemaTypeName => Real.SchemaTypeName; | ||
//public XmlSchemaSimpleType SchemaType => Real.SchemaType; | ||
public XmlSchemaSimpleType AttributeSchemaType => Real.AttributeSchemaType; | ||
|
||
public XmlSchemaAnnotated Base => Real; | ||
|
||
public XmlSchemaForm FormDefault => Base.GetSchema().AttributeFormDefault; | ||
|
||
//XmlSchemaType IXmlSchemaNode.SchemaType => SchemaType; | ||
|
||
//XmlSchemaType IXmlSchemaNode.NodeSchemaType => AttributeSchemaType; | ||
|
||
public XmlSchemaUse Use => Real.Use; | ||
|
||
public static implicit operator XmlSchemaAttributeEx(XmlSchemaAttribute xs) => new(xs); | ||
public static implicit operator XmlSchemaAttribute(XmlSchemaAttributeEx ex) => ex.Real; | ||
} | ||
|
||
public sealed class XmlSchemaElementEx : IXmlSchemaNode | ||
{ | ||
private XmlSchemaElementEx(XmlSchemaElement xs) => Real = xs; | ||
|
||
public XmlSchemaElement Real { get; } | ||
|
||
//public string Name => Real.Name; | ||
public string DefaultValue => Real.DefaultValue; | ||
public string FixedValue => Real.FixedValue; | ||
public XmlSchemaForm Form => Real.Form; | ||
public XmlQualifiedName QualifiedName => Real.QualifiedName; | ||
public XmlQualifiedName RefName => Real.RefName; | ||
//public XmlQualifiedName SchemaTypeName => Real.SchemaTypeName; | ||
//public XmlSchemaType SchemaType => Real.SchemaType; | ||
public XmlSchemaType ElementSchemaType => Real.ElementSchemaType; | ||
|
||
public XmlSchemaAnnotated Base => Real; | ||
|
||
public XmlSchemaForm FormDefault => Base.GetSchema().ElementFormDefault; | ||
|
||
//XmlSchemaType IXmlSchemaNode.SchemaType => SchemaType; | ||
|
||
//XmlSchemaType IXmlSchemaNode.NodeSchemaType => ElementSchemaType; | ||
|
||
public bool IsNillable => Real.IsNillable; | ||
|
||
public static implicit operator XmlSchemaElementEx(XmlSchemaElement xs) => new(xs); | ||
public static implicit operator XmlSchemaElement(XmlSchemaElementEx ex) => ex.Real; | ||
} | ||
} |
Oops, something went wrong.