From: Carlos G. Á. <car...@us...> - 2005-09-10 12:12:26
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25310 Modified Files: PgConnectionInternal.cs Added Files: PgConnectionStringBuilder.cs Log Message: Started the reorganization of the CVS module --- NEW FILE: PgConnectionStringBuilder.cs --- /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+ * Copyright (c) 2003-2005 Carlos Guzman Alvarez * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Data; using System.Data.Common; namespace PostgreSql.Data.PostgreSqlClient { public sealed class PgConnectionStringBuilder : DbConnectionStringBuilder { #region · Properties · public string DataSource { get { return this.GetString("Data Source"); } set { this["Data Source"] = value; } } public string Database { get { return this.GetString("Database"); } set { this["Database"] = value; } } public string UserID { get { return this.GetString("User ID"); } set { this["User ID"] = value; } } public string Password { get { return this.GetString("Password"); } set { this["Password"] = value; } } public int Port { get { return this.GetInt32("Port Number"); } set { this["Port Number"] = value; } } public int PacketSize { get { return this.GetInt32("Packet Size"); } set { this["Packet Size"] = value; } } public int ConnectionTimeout { get { return this.GetInt32("Connection Timeout"); } set { this["Connection Timeout"] = value; } } public bool Pooling { get { return this.GetBoolean("Pooling"); } set { this["Pooling"] = value; } } public int ConnectionLifeTime { get { return this.GetInt32("Connection Lifetime"); } set { this["Connection Lifetime"] = value; } } public int MinPoolSize { get { return this.GetInt32("Min Pool Size"); } set { this["Min Pool Size"] = value; } } public int MaxPoolSize { get { return this.GetInt32("Max Pool Size"); } set { this["Max Pool Size"] = value; } } public bool Ssl { get { return this.GetBoolean("SSL"); } set { this["SSL"] = value; } } #endregion #region · Constructors · public PgConnectionStringBuilder() { } public PgConnectionStringBuilder(string connectionString) { this.ConnectionString = connectionString; } #endregion #region · Private methods · private int GetInt32(string keyword) { return Convert.ToInt32(this[keyword]); } private string GetString(string keyword) { return Convert.ToString(this[keyword]); } private bool GetBoolean(string keyword) { return Convert.ToBoolean(this[keyword]); } #endregion } } Index: PgConnectionInternal.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgConnectionInternal.cs 9 Sep 2005 21:35:00 -0000 1.2 --- PgConnectionInternal.cs 10 Sep 2005 12:12:14 -0000 1.3 *************** *** 275,279 **** switch (element.Groups[1].Value.Trim().ToLower()) { ! case "datasource": case "server": case "host": --- 275,279 ---- switch (element.Groups[1].Value.Trim().ToLower()) { ! case "data source": case "server": case "host": *************** *** 286,289 **** --- 286,290 ---- case "user name": + case "user id": case "user": this.options.UserName = element.Groups[2].Value.Trim(); *************** *** 296,306 **** case "port": this.options.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); break; - case "connection lifetime": - this.lifetime = Int32.Parse(element.Groups[2].Value.Trim()); - break; - case "timeout": case "connection timeout": --- 297,304 ---- case "port": + case "port number": this.options.ServerPort = Int32.Parse(element.Groups[2].Value.Trim()); break; case "timeout": case "connection timeout": *************** *** 316,319 **** --- 314,327 ---- break; + case "connection lifetime": + this.lifetime = Int32.Parse(element.Groups[2].Value.Trim()); + break; + + case "min pool size": + throw new NotImplementedException(); + + case "max pool size": + throw new NotImplementedException(); + case "ssl": this.options.SSL = Boolean.Parse(element.Groups[2].Value.Trim()); |