1 //------------------------------------------------------------------------------
2 // <copyright file="SoapAttributes.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Serialization {
10 using System.Reflection;
11 using System.Collections;
12 using System.ComponentModel;
14 internal enum SoapAttributeFlags {
21 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes"]/*' />
23 /// <para>[To be supplied.]</para>
25 public class SoapAttributes {
27 SoapTypeAttribute soapType;
28 SoapElementAttribute soapElement;
29 SoapAttributeAttribute soapAttribute;
30 SoapEnumAttribute soapEnum;
31 object soapDefaultValue = null;
33 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapAttributes"]/*' />
35 /// <para>[To be supplied.]</para>
37 public SoapAttributes() {
40 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapAttributes1"]/*' />
42 /// <para>[To be supplied.]</para>
44 public SoapAttributes(ICustomAttributeProvider provider) {
45 object[] attrs = provider.GetCustomAttributes(false);
46 for (int i = 0; i < attrs.Length; i++) {
47 if (attrs[i] is SoapIgnoreAttribute || attrs[i] is ObsoleteAttribute) {
48 this.soapIgnore = true;
51 else if (attrs[i] is SoapElementAttribute) {
52 this.soapElement = (SoapElementAttribute)attrs[i];
54 else if (attrs[i] is SoapAttributeAttribute) {
55 this.soapAttribute = (SoapAttributeAttribute)attrs[i];
57 else if (attrs[i] is SoapTypeAttribute) {
58 this.soapType = (SoapTypeAttribute)attrs[i];
60 else if (attrs[i] is SoapEnumAttribute) {
61 this.soapEnum = (SoapEnumAttribute)attrs[i];
63 else if (attrs[i] is DefaultValueAttribute) {
64 this.soapDefaultValue = ((DefaultValueAttribute)attrs[i]).Value;
68 this.soapElement = null;
69 this.soapAttribute = null;
72 this.soapDefaultValue = null;
76 internal SoapAttributeFlags SoapFlags {
78 SoapAttributeFlags flags = 0;
79 if (soapElement != null) flags |= SoapAttributeFlags.Element;
80 if (soapAttribute != null) flags |= SoapAttributeFlags.Attribute;
81 if (soapEnum != null) flags |= SoapAttributeFlags.Enum;
82 if (soapType != null) flags |= SoapAttributeFlags.Type;
87 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapType"]/*' />
89 /// <para>[To be supplied.]</para>
91 public SoapTypeAttribute SoapType {
92 get { return soapType; }
93 set { soapType = value; }
96 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapEnum"]/*' />
98 /// <para>[To be supplied.]</para>
100 public SoapEnumAttribute SoapEnum {
101 get { return soapEnum; }
102 set { soapEnum = value; }
105 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapIgnore"]/*' />
107 /// <para>[To be supplied.]</para>
109 public bool SoapIgnore {
110 get { return soapIgnore; }
111 set { soapIgnore = value; }
114 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapElement"]/*' />
116 /// <para>[To be supplied.]</para>
118 public SoapElementAttribute SoapElement {
119 get { return soapElement; }
120 set { soapElement = value; }
123 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapAttribute"]/*' />
125 /// <para>[To be supplied.]</para>
127 public SoapAttributeAttribute SoapAttribute {
128 get { return soapAttribute; }
129 set { soapAttribute = value; }
132 /// <include file='doc\SoapAttributes.uex' path='docs/doc[@for="SoapAttributes.SoapDefaultValue"]/*' />
134 /// <para>[To be supplied.]</para>
136 public object SoapDefaultValue {
137 get { return soapDefaultValue; }
138 set { soapDefaultValue = value; }