(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Addressing / AttributedUri.cs
blob824040b560250fd56d42d6d942ebe6f3a9355640
1 //
2 // Microsoft.Web.Services.Addressing.AttributedUri
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
8 using System;
9 using System.Net;
10 using System.Xml;
11 using Microsoft.Web.Services.Xml;
13 namespace Microsoft.Web.Services.Addressing
16 public abstract class AttributedUri : OpenAttributeElement
19 private Uri _value;
21 public AttributedUri (Uri uri) : base ()
23 if(uri == null) {
24 throw new ArgumentNullException ("uri");
27 _value = uri;
30 public AttributedUri (AttributedUri aUri) : base ()
33 _value = aUri.Value;
35 foreach (XmlAttribute attribute in aUri.AnyAttributes) {
37 AnyAttributes.Add (attribute);
43 public AttributedUri () : base ()
47 public void GetXmlUri (XmlDocument document, XmlElement element)
49 if(element == null) {
50 throw new ArgumentNullException ("element");
53 element.InnerText = _value.ToString();
55 GetXmlAny(document, element);
58 public void LoadXmlUri (XmlElement element)
60 if(element == null) {
61 throw new ArgumentNullException ("element");
64 ValidateSchema (element);
66 LoadXmlAny (element);
68 _value = new Uri(element.InnerText);
72 public void ValidateSchema (XmlElement element)
74 if(element.ChildNodes.Count > 1) {
75 throw new AddressingFormatException ("wsa_InvalidAttributeUri");
77 if(element.ChildNodes.Count == 1 && !(element.FirstChild is XmlText)) {
78 throw new AddressingFormatException ("wsa_InvalidAttributeUri");
82 public Uri Value {
83 get { return _value; }
84 set { _value = value; }