Files
mono/mcs/class/System.Web.Services/System.Web.Services.Description/MessageCollection.cs
T
Tim Coleman ea278b331e 2002-08-09 Tim Coleman <[email protected]>
* BindingCollection.cs:
        * ServiceDescriptionCollection.cs:
                Implement Set indexer
        * FaultBindingCollection.cs:
        * MessageCollection.cs:
        * MessagePartCollection.cs:
        * OperationFaultCollection.cs:
        * PortCollection.cs:
        * PortTypeCollection.cs:
        * ServiceCollection.cs:
                Implement Set indexer, code cleanup
        * Message.cs:
                Implement FindPartByName ()
        * OperationMessageCollection.cs:
                Alter OnSet () method
        * ServiceDescriptionBaseCollection.cs:
                Implement some methods.
        * ServiceDescriptionFormatExtensionCollection.cs:
                Implement Find (), FindAll (), OnValidate () methods

svn path=/trunk/mcs/; revision=6571
2002-08-10 08:05:47 +00:00

96 lines
1.9 KiB
C#

//
// System.Web.Services.Description.MessageCollection.cs
//
// Author:
// Tim Coleman ([email protected])
//
// Copyright (C) Tim Coleman, 2002
//
namespace System.Web.Services.Description {
public sealed class MessageCollection : ServiceDescriptionBaseCollection {
#region Fields
ServiceDescription serviceDescription;
#endregion // Fields
#region Constructors
internal MessageCollection (ServiceDescription serviceDescription)
{
this.serviceDescription = serviceDescription;
}
#endregion
#region Properties
public Message this [int index] {
get {
if (index < 0 || index > Count)
throw new ArgumentOutOfRangeException ();
return (Message) List [index];
}
set { List [index] = value; }
}
public Message this [string name] {
get { return this [IndexOf ((Message) Table [name])]; }
}
#endregion // Properties
#region Methods
public int Add (Message message)
{
Insert (Count, message);
return (Count - 1);
}
public bool Contains (Message message)
{
return List.Contains (message);
}
public void CopyTo (Message[] array, int index)
{
List.CopyTo (array, index);
}
protected override string GetKey (object value)
{
if (!(value is Message))
throw new InvalidCastException ();
return ((Message) value).Name;
}
public int IndexOf (Message message)
{
return List.IndexOf (message);
}
public void Insert (int index, Message message)
{
SetParent (message, serviceDescription);
List.Insert (index, message);
}
public void Remove (Message message)
{
List.Remove (message);
}
protected override void SetParent (object value, object parent)
{
((Message) value).SetParent ((ServiceDescription) parent);
}
#endregion // Methods
}
}