2 * Firebird ADO.NET Data provider for .NET and Mono
4 * The contents of this file are subject to the Initial
5 * Developer's Public License Version 1.0 (the "License");
6 * you may not use this file except in compliance with the
7 * License. You may obtain a copy of the License at
8 * http://www.firebirdsql.org/index.php?op=doc&id=idpl
10 * Software distributed under the License is distributed on
11 * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
12 * express or implied. See the License for the specific
13 * language governing rights and limitations under the License.
15 * Copyright (c) 2002, 2005 Carlos Guzman Alvarez
16 * All Rights Reserved.
21 using System.Collections;
23 namespace FirebirdSql.Data.Common
25 internal sealed class CharsetCollection : CollectionBase
29 public Charset this[int index]
31 get { return (Charset)this.List[index]; }
34 public Charset this[string name]
36 get { return (Charset)this[this.IndexOf(name)]; }
43 public int IndexOf(int id)
47 foreach (Charset item in this)
59 public int IndexOf(string name)
63 foreach (Charset item in this)
65 if (GlobalizationHelper.CultureAwareCompare(item.Name, name))
78 int bytesPerCharacter,
81 Charset charSet = new Charset(
82 id, charset, bytesPerCharacter, systemCharset);
84 return this.Add(charSet);
87 internal Charset Add(Charset charset)
89 this.List.Add(charset);