2003-10-05 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Xml / OpenAttributeElement.cs
1 //
2 // Microsoft.Web.Services.Xml
3 //
4 // Author: Todd Berman <tberman@gentoo.org>
5 //
6 // (C) 2003 Todd Berman
7
8 using System;
9 using System.Xml;
10 using System.Collections;
11
12 namespace Microsoft.Web.Services.Xml
13 {
14
15         public abstract class OpenAttributeElement
16         {
17                 
18                 private ArrayList _any;
19                 
20                 public OpenAttributeElement ()
21                 {
22                         _any = new ArrayList ();
23                 }
24
25                 public void GetXmlAny (XmlDocument document, XmlElement element)
26                 {
27                         if(document == null) {
28                                 throw new ArgumentNullException ("document");
29                         }
30                         if(element == null) {
31                                 throw new ArgumentNullException ("element");
32                         }
33
34                         foreach(XmlAttribute attrib in AnyAttributes) {
35                                 element.Attributes.Append((XmlAttribute)document.ImportNode(attrib, true));
36                         }
37                 }
38
39                 public void LoadXmlAny (XmlElement element)
40                 {
41                         if(element == null) {
42                                 throw new ArgumentNullException ("element");
43                         }
44                         foreach(XmlAttribute attrib in element.Attributes) {
45                                 AnyAttributes.Add(attrib);
46                         }
47                 }
48
49                 public IList AnyAttributes {
50                         get { return _any; }
51                 }
52         
53         }
54         
55 }