Removed:
trunk/mysqlclient/common/Resources.cs
Modified:
trunk/mysqlclient/common/NamedPipeStream.cs
trunk/mysqlclient/common/Version.cs
Log:
Removed the unneeded Resources class
Changed calls of .GetString() in NamedPipeStream to the generated methods of
Resources.resx
Modified: trunk/mysqlclient/common/NamedPipeStream.cs
===================================================================
--- trunk/mysqlclient/common/NamedPipeStream.cs 2006-08-18 21:20:54 UTC (rev 321)
+++ trunk/mysqlclient/common/NamedPipeStream.cs 2006-08-18 21:27:49 UTC (rev 322)
@@ -20,6 +20,7 @@
using System;
using System.IO;
+using MySql.Data.MySqlClient;
namespace MySql.Data.Common
@@ -64,17 +65,17 @@
public override bool CanSeek
{
- get { throw new NotSupportedException(Resources.GetString("NamedPipeNoSeek")); }
+ get { throw new NotSupportedException(Resources.NamedPipeNoSeek); }
}
public override long Length
{
- get { throw new NotSupportedException(Resources.GetString("NamedPipeNoSeek")); }
+ get { throw new NotSupportedException(Resources.NamedPipeNoSeek); }
}
public override long Position
{
- get { throw new NotSupportedException(Resources.GetString("NamedPipeNoSeek")); }
+ get { throw new NotSupportedException(Resources.NamedPipeNoSeek); }
set { }
}
@@ -88,21 +89,21 @@
{
if (buffer == null)
throw new ArgumentNullException("buffer",
- Resources.GetString("BufferCannotBeNull"));
+ Resources.BufferCannotBeNull);
if (buffer.Length < (offset + count))
throw new ArgumentException(
- Resources.GetString("BufferNotLargeEnough"));
+ Resources.BufferNotLargeEnough);
if (offset < 0)
throw new ArgumentOutOfRangeException("offset", offset,
- Resources.GetString("OffsetCannotBeNegative"));
+ Resources.OffsetCannotBeNegative);
if (count < 0)
throw new ArgumentOutOfRangeException("count", count,
- Resources.GetString("CountCannotBeNegative"));
+ Resources.CountCannotBeNegative);
if (! CanRead)
- throw new NotSupportedException(Resources.GetString("StreamNoRead"));
+ throw new NotSupportedException(Resources.StreamNoRead);
if (pipeHandle == 0)
throw new ObjectDisposedException("NamedPipeStream",
- Resources.GetString("StreamAlreadyClosed"));
+ Resources.StreamAlreadyClosed);
// first read the data into an internal buffer since ReadFile cannot read into a buf
at
// a specified offset
@@ -115,7 +116,7 @@
{
Close();
throw new MySqlClient.MySqlException(
- Resources.GetString("ReadFromStreamFailed"), true, null);
+ Resources.ReadFromStreamFailed, true, null);
}
Array.Copy(buf, (int)0, buffer, (int)offset, (int)read);
@@ -133,26 +134,26 @@
public override void SetLength(long length)
{
- throw new NotSupportedException(Resources.GetString("NamedPipeNoSetLength"));
+ throw new NotSupportedException(Resources.NamedPipeNoSetLength);
}
public override void Write(byte[] buffer, int offset, int count)
{
if (buffer == null)
- throw new ArgumentNullException("buffer", Resources.GetString("BufferCannotBeNull"));
+ throw new ArgumentNullException("buffer", Resources.BufferCannotBeNull);
if (buffer.Length < (offset + count))
- throw new ArgumentException(Resources.GetString("BufferNotLargeEnough"), "buffer");
+ throw new ArgumentException(Resources.BufferNotLargeEnough, "buffer");
if (offset < 0)
throw new ArgumentOutOfRangeException("offset", offset,
- Resources.GetString("OffsetCannotBeNegative"));
+ Resources.OffsetCannotBeNegative);
if (count < 0)
throw new ArgumentOutOfRangeException("count", count,
- Resources.GetString("CountCannotBeNegative"));
+ Resources.CountCannotBeNegative);
if (! CanWrite)
- throw new NotSupportedException(Resources.GetString("StreamNoWrite"));
+ throw new NotSupportedException(Resources.StreamNoWrite);
if (pipeHandle == 0)
throw new ObjectDisposedException("NamedPipeStream",
- Resources.GetString("StreamAlreadyClosed"));
+ Resources.StreamAlreadyClosed);
// copy data to internal buffer to allow writing from a specified offset
uint bytesWritten = 0;
@@ -180,7 +181,7 @@
if (! result)
{
Close();
- throw new MySqlClient.MySqlException(Resources.GetString("WriteToStreamFailed"),
+ throw new MySqlClient.MySqlException(Resources.WriteToStreamFailed,
true, null);
}
if (bytesWritten < count)
@@ -189,7 +190,7 @@
public override long Seek( long offset, SeekOrigin origin )
{
- throw new NotSupportedException(Resources.GetString("NamedPipeNoSeek"));
+ throw new NotSupportedException(Resources.NamedPipeNoSeek);
}
}
}
Deleted: trunk/mysqlclient/common/Resources.cs
===================================================================
--- trunk/mysqlclient/common/Resources.cs 2006-08-18 21:20:54 UTC (rev 321)
+++ trunk/mysqlclient/common/Resources.cs 2006-08-18 21:27:49 UTC (rev 322)
@@ -1,38 +0,0 @@
-// Copyright (C) 2004-2006 MySQL AB
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as published by
-// the Free Software Foundation
-//
-// There are special exceptions to the terms and conditions of the GPL
-// as it is applied to this software. View the full text of the
-// exception in file EXCEPTIONS in the directory of this software
-// distribution.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Resources;
-
-namespace MySql.Data.Common
-{
- internal class Resources
- {
- private static ResourceManager rm = null;
-
- public static string GetString(string name)
- {
- if (rm == null)
- rm = new ResourceManager("MySql.Data.MySqlClient.MySqlClient.Strings",
- System.Reflection.Assembly.GetCallingAssembly());
- return rm.GetString (name);
- }
- }
-}
Modified: trunk/mysqlclient/common/Version.cs
===================================================================
--- trunk/mysqlclient/common/Version.cs 2006-08-18 21:20:54 UTC (rev 321)
+++ trunk/mysqlclient/common/Version.cs 2006-08-18 21:27:49 UTC (rev 322)
@@ -61,14 +61,14 @@
int start = 0;
int index = versionString.IndexOf('.', start);
if (index == -1)
- throw new MySqlException(Resources.GetString("BadVersionFormat"));
+ throw new MySqlException(Resources.BadVersionFormat);
string val = versionString.Substring(start, index-start).Trim();
int major = Convert.ToInt32(val, System.Globalization.NumberFormatInfo.InvariantInfo);
start = index+1;
index = versionString.IndexOf('.', start);
if (index == -1)
- throw new MySqlException(Resources.GetString("BadVersionFormat"));
+ throw new MySqlException(Resources.BadVersionFormat);
val = versionString.Substring(start, index-start).Trim();
int minor = Convert.ToInt32(val, System.Globalization.NumberFormatInfo.InvariantInfo);
| Thread |
|---|
| • Connector/NET commit: r322 - trunk/mysqlclient/common | rburnett | 18 Aug |