[threadpool] Added dynamic concurrent queue implementation
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / Message.cs
index 1a453e477c185a25fc6e34aed78d3c293fe22091..0e1e37e7980f5fb04f30aaff41ebb6fe9e9c52c1 100644 (file)
-// \r
-// System.Web.Services.Description.Message.cs\r
-//\r
-// Author:\r
-//   Tim Coleman (tim@timcoleman.com)\r
-//\r
-// Copyright (C) Tim Coleman, 2002\r
-//\r
-\r
-using System.Collections;\r
-using System.Web.Services;\r
-\r
-namespace System.Web.Services.Description {\r
-       public sealed class Message : DocumentableItem {\r
-\r
-               #region Fields\r
-\r
-               string name;\r
-               MessagePartCollection parts;\r
-               ServiceDescription serviceDescription;\r
-\r
-               #endregion // Fields\r
-\r
-               #region Constructors\r
-               \r
-               public Message ()\r
-               {\r
-                       name = String.Empty;\r
-                       parts = new MessagePartCollection (this);\r
-                       serviceDescription = null;\r
-               }\r
-               \r
-               #endregion // Constructors\r
-\r
-               #region Properties\r
-\r
-               public string Name {\r
-                       get { return name; }\r
-                       set { name = value; }\r
-               }\r
-\r
-               public MessagePartCollection Parts {\r
-                       get { return parts; }\r
-                       set { parts = value; }\r
-               }\r
-\r
-               public ServiceDescription ServiceDescription {\r
-                       get { return serviceDescription; }\r
-               }\r
-\r
-               #endregion // Properties\r
-\r
-               #region Methods\r
-\r
-               [MonoTODO]\r
-               public MessagePart FindPartByName (string partName)\r
-               {\r
-                       throw new NotImplementedException ();\r
-               }\r
-\r
-               [MonoTODO]\r
-               public MessagePart[] FindPartsByName (string[] partNames) \r
-               {\r
-                       ArrayList searchResults = new ArrayList ();\r
-\r
-                       foreach (string partName in partNames)\r
-                               searchResults.Add (FindPartByName (partName));\r
-\r
-                       int count = searchResults.Count;\r
-\r
-                       if (count == 0)\r
-                               throw new ArgumentException ();\r
-\r
-                       MessagePart[] returnValue = new MessagePart[count];\r
-                       searchResults.CopyTo (returnValue);\r
-                       return returnValue;\r
-               }\r
-\r
-               internal void SetParent (ServiceDescription serviceDescription)\r
-               {\r
-                       this.serviceDescription = serviceDescription;\r
-               }\r
-\r
-               #endregion\r
-       }\r
-}\r
+// 
+// System.Web.Services.Description.Message.cs
+//
+// Author:
+//   Tim Coleman (tim@timcoleman.com)
+//
+// Copyright (C) Tim Coleman, 2002
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections;
+using System.Web.Services;
+using System.Web.Services.Configuration;
+using System.Xml.Serialization;
+
+namespace System.Web.Services.Description 
+{
+#if NET_2_0
+       [XmlFormatExtensionPoint ("Extensions")]
+#endif
+       public sealed class Message :
+#if NET_2_0
+               NamedItem
+#else
+               DocumentableItem 
+#endif
+       {
+               #region Fields
+
+#if !NET_2_0
+               string name;
+#endif
+               MessagePartCollection parts;
+               ServiceDescription serviceDescription;
+#if NET_2_0
+               ServiceDescriptionFormatExtensionCollection extensions;
+#endif
+
+               #endregion // Fields
+
+               #region Constructors
+               
+               public Message ()
+               {
+#if !NET_2_0
+                       name = String.Empty;
+#endif
+#if NET_2_0
+                       extensions = new ServiceDescriptionFormatExtensionCollection (this);
+#endif
+                       parts = new MessagePartCollection (this);
+                       serviceDescription = null;
+               }
+               
+               #endregion // Constructors
+
+               #region Properties
+
+#if !NET_2_0
+               [XmlAttribute ("name", DataType = "NCName")]
+               public string Name {
+                       get { return name; }
+                       set { name = value; }
+               }
+#endif
+
+               [XmlElement ("part")]
+               public MessagePartCollection Parts {
+                       get { return parts; }
+               }
+
+//             [XmlIgnore]
+               public ServiceDescription ServiceDescription {
+                       get { return serviceDescription; }
+               }
+
+#if NET_2_0
+               [XmlIgnore]
+               public override ServiceDescriptionFormatExtensionCollection Extensions {
+                       get { return extensions; }
+               }
+#endif
+
+               #endregion // Properties
+
+               #region Methods
+
+               public MessagePart FindPartByName (string partName)
+               {
+                       return parts [partName];
+               }
+
+               public MessagePart[] FindPartsByName (string[] partNames) 
+               {
+                       ArrayList searchResults = new ArrayList ();
+
+                       foreach (string partName in partNames)
+                               searchResults.Add (FindPartByName (partName));
+
+                       int count = searchResults.Count;
+
+                       if (count == 0)
+                               throw new ArgumentException ();
+
+                       MessagePart[] returnValue = new MessagePart[count];
+                       searchResults.CopyTo (returnValue);
+                       return returnValue;
+               }
+
+               internal void SetParent (ServiceDescription serviceDescription)
+               {
+                       this.serviceDescription = serviceDescription;
+               }
+
+               #endregion
+       }
+}