/// </summary>
public class XmlAttributes
{
+#if !MOONLIGHT
private XmlAnyAttributeAttribute xmlAnyAttribute;
+#endif
private XmlAnyElementAttributes xmlAnyElements = new XmlAnyElementAttributes();
private XmlArrayAttribute xmlArray;
private XmlArrayItemAttributes xmlArrayItems = new XmlArrayItemAttributes();
object[] attributes = provider.GetCustomAttributes(false);
foreach(object obj in attributes)
{
+#if !MOONLIGHT
if(obj is XmlAnyAttributeAttribute)
xmlAnyAttribute = (XmlAnyAttributeAttribute) obj;
- else if(obj is XmlAnyElementAttribute)
+ else
+#endif
+ if(obj is XmlAnyElementAttribute)
xmlAnyElements.Add((XmlAnyElementAttribute) obj);
else if(obj is XmlArrayAttribute)
xmlArray = (XmlArrayAttribute) obj;
}
#region public properties
+#if !MOONLIGHT
public XmlAnyAttributeAttribute XmlAnyAttribute
{
get
xmlAnyAttribute = value;
}
}
+#endif
public XmlAnyElementAttributes XmlAnyElements
{
get
KeyHelper.AddField (sb, 1, xmlIgnore);
KeyHelper.AddField (sb, 2, xmlns);
+#if !MOONLIGHT
KeyHelper.AddField (sb, 3, xmlAnyAttribute!=null);
+#endif
xmlAnyElements.AddKeyHash (sb);
xmlArrayItems.AddKeyHash (sb);
sb.Append ("|");
}
+
+ internal int? Order {
+ get {
+ int? order = null;
+ if (XmlElements.Count > 0)
+ order = XmlElements.Order;
+ else if (XmlArray != null)
+ order = XmlArray.Order;
+ else if (XmlAnyElements.Count > 0)
+ order = XmlAnyElements.Order;
+ return order;
+ }
+ }
+
+ internal int SortableOrder {
+ get { return Order != null ? (int) Order : int.MinValue; }
+ }
}
}