/
XmlSchemaObject.cs
94 lines (80 loc) · 2.6 KB
/
XmlSchemaObject.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Xml.Serialization;
namespace System.Xml.Schema
{
public abstract class XmlSchemaObject
{
private int _lineNum;
private int _linePos;
private string? _sourceUri;
private XmlSerializerNamespaces? _namespaces;
private XmlSchemaObject? _parent;
//internal
private bool _isProcessing; //Indicates whether this object is currently being processed
[XmlIgnore]
public int LineNumber
{
get { return _lineNum; }
set { _lineNum = value; }
}
[XmlIgnore]
public int LinePosition
{
get { return _linePos; }
set { _linePos = value; }
}
[XmlIgnore]
public string? SourceUri
{
get { return _sourceUri; }
set { _sourceUri = value; }
}
[XmlIgnore]
public XmlSchemaObject? Parent
{
get { return _parent; }
set { _parent = value; }
}
[XmlNamespaceDeclarations]
public XmlSerializerNamespaces Namespaces
{
get => _namespaces ??= new XmlSerializerNamespaces();
set => _namespaces = value;
}
internal virtual void OnAdd(XmlSchemaObjectCollection container, object? item) { }
internal virtual void OnRemove(XmlSchemaObjectCollection container, object? item) { }
internal virtual void OnClear(XmlSchemaObjectCollection container) { }
[XmlIgnore]
internal virtual string? IdAttribute
{
get { Debug.Fail("Should not use base property"); return null; }
set { Debug.Fail("Should not use base property"); }
}
internal virtual void SetUnhandledAttributes(XmlAttribute[] moreAttributes) { }
internal virtual void AddAnnotation(XmlSchemaAnnotation annotation) { }
[XmlIgnore]
internal virtual string? NameAttribute
{
get { Debug.Fail("Should not use base property"); return null; }
set { Debug.Fail("Should not use base property"); }
}
[XmlIgnore]
internal bool IsProcessing
{
get
{
return _isProcessing;
}
set
{
_isProcessing = value;
}
}
internal virtual XmlSchemaObject Clone()
{
return (XmlSchemaObject)MemberwiseClone();
}
}
}