2 // Microsoft.Web.Services.Dime.DimeAttachmentCollection.cs
4 // Name: Daniel Kornhauser <dkor@alum.mit.edu>
6 // Copyright (C) Ximian, Inc. 2003
9 using Microsoft.Web.Services;
11 using System.Collections;
12 using System.Globalization;
14 namespace Microsoft.Web.Services.Dime {
17 public class DimeAttachmentCollection : CollectionBase
22 public DimeAttachmentCollection ()
26 public DimeAttachmentCollection (DimeReader reader)
29 throw new ArgumentNullException (
30 Locale.GetText ("Argument is null."));
33 if (reader.CanRead == false)
34 throw new ArgumentException (
35 Locale.GetText ("The reader is not readable"));
40 public DimeAttachment this [int key] {
42 return (DimeAttachment) InnerList [key];
46 public DimeAttachment this [string key] {
48 // FIXME: must iterate in collection
53 public void Add (DimeAttachment attachment)
55 InnerList.Add (attachment);
58 public void AddRange (ICollection collection)
60 foreach (object o in collection)
64 public bool Contains (string id)
66 return InnerList.Contains (id);
69 public void CopyTo (DimeAttachment[] attachments, int index)
71 InnerList.CopyTo (attachments, index);
74 public int IndexOf (DimeAttachment attachment)
76 return InnerList.IndexOf(attachment);
79 public int IndexOf (string id)
81 return InnerList.IndexOf(id);
84 public void Remove (DimeAttachment attachment)
86 InnerList.Remove (attachment);