-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SyndicationCategory.cs
84 lines (65 loc) · 2.57 KB
/
SyndicationCategory.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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Xml;
namespace System.ServiceModel.Syndication
{
// NOTE: This class implements Clone so if you add any members, please update the copy ctor
public class SyndicationCategory : IExtensibleSyndicationObject
{
private ExtensibleSyndicationObject _extensions;
public SyndicationCategory() : this((string)null)
{
}
public SyndicationCategory(string name) : this(name, null, null)
{
}
public SyndicationCategory(string name, string scheme, string label)
{
Name = name;
Scheme = scheme;
Label = label;
}
protected SyndicationCategory(SyndicationCategory source)
{
if (source is null)
{
throw new ArgumentNullException(nameof(source));
}
Label = source.Label;
Name = source.Name;
Scheme = source.Scheme;
_extensions = source._extensions.Clone();
}
public Dictionary<XmlQualifiedName, string> AttributeExtensions => _extensions.AttributeExtensions;
public SyndicationElementExtensionCollection ElementExtensions => _extensions.ElementExtensions;
public string Label { get; set; }
public string Name { get; set; }
public string Scheme { get; set; }
public virtual SyndicationCategory Clone() => new SyndicationCategory(this);
protected internal virtual bool TryParseAttribute(string name, string ns, string value, string version)
{
return false;
}
protected internal virtual bool TryParseElement(XmlReader reader, string version)
{
return false;
}
protected internal virtual void WriteAttributeExtensions(XmlWriter writer, string version)
{
_extensions.WriteAttributeExtensions(writer);
}
protected internal virtual void WriteElementExtensions(XmlWriter writer, string version)
{
_extensions.WriteElementExtensions(writer);
}
internal void LoadElementExtensions(XmlReader readerOverUnparsedExtensions, int maxExtensionSize)
{
_extensions.LoadElementExtensions(readerOverUnparsedExtensions, maxExtensionSize);
}
internal void LoadElementExtensions(XmlBuffer buffer)
{
_extensions.LoadElementExtensions(buffer);
}
}
}