// Miguel de Icaza (miguel@ximian.com)
//
// (C) 2001 Ximian, Inc.
-//
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
//
// Properties
//
- public CodeCatchClause this[int index] {
- get {
- return (CodeCatchClause)List[index];
- }
+ public CodeCatchClause this[int index] {
+ get {
+ return (CodeCatchClause)List[index];
+ }
set {
List[index] = value;
}
- }
+ }
//
// Methods
public void AddRange (CodeCatchClause [] value)
{
- foreach (CodeCatchClause ca in value)
- Add (ca);
+ if (value == null) {
+ throw new ArgumentNullException ("value");
+ }
+
+ for (int i = 0; i < value.Length; i++) {
+ Add (value[i]);
+ }
}
public void AddRange (CodeCatchClauseCollection value )
{
- foreach (CodeCatchClause ca in value)
- Add (ca);
+ if (value == null) {
+ throw new ArgumentNullException ("value");
+ }
+
+ int count = value.Count;
+ for (int i = 0; i < count; i++) {
+ Add (value[i]);
+ }
}
public bool Contains( CodeCatchClause value )
public void Remove( CodeCatchClause value )
{
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
+ List.Remove (value);
}
}
}