Prechádzať zdrojové kódy

2008-09-13 Daniel Morgan <[email protected]>

	* System.Data.OracleClient/OracleConnection.cs: add stubs
	for method GetSchema which is part of NET_2_0, and clean up warnings

	* System.Data.OracleClient/OracleCommand.cs
	* ystem.Data.OracleClient/OracleParameter.cs
	* System.Data.OracleClient/OracleBFile.cs
	* System.Data.OracleClient.Oci/OciHandle.cs: clean up warnings

	* System.Data.OracleClient.Oci/OciDescriptorHandle.cs
	* System.Data.OracleClient.Oci/OciDefineHandle.cs: make methods internal

svn path=/trunk/mcs/; revision=112925
Daniel Morgan 17 rokov pred
rodič
commit
b575dfd355

+ 13 - 0
mcs/class/System.Data.OracleClient/ChangeLog

@@ -1,3 +1,16 @@
+2008-09-13  Daniel Morgan <[email protected]>
+
+	* System.Data.OracleClient/OracleConnection.cs: add stubs
+	for method GetSchema which is part of NET_2_0, and clean up warnings
+
+	* System.Data.OracleClient/OracleCommand.cs
+	* ystem.Data.OracleClient/OracleParameter.cs
+	* System.Data.OracleClient/OracleBFile.cs
+	* System.Data.OracleClient.Oci/OciHandle.cs: clean up warnings
+
+	* System.Data.OracleClient.Oci/OciDescriptorHandle.cs
+	* System.Data.OracleClient.Oci/OciDefineHandle.cs: make methods internal
+
 2008-09-13  Daniel Morgan <[email protected]>
 
 	* Test/TestOracleClient.cs: add test for LONG (long varchar)

+ 13 - 13
mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs

@@ -30,7 +30,7 @@ namespace System.Data.OracleClient.Oci
 
 		bool disposed = false;
 
-		IntPtr handle = IntPtr.Zero;
+		//IntPtr handle;
 		IntPtr value;
 		short indicator;
 		//OracleType type;
@@ -59,12 +59,12 @@ namespace System.Data.OracleClient.Oci
 
 		#region Constructors
 
-		public OciDefineHandle (OciHandle parent, IntPtr newHandle)
+		internal OciDefineHandle (OciHandle parent, IntPtr newHandle)
 			: base (OciHandleType.Define, parent, newHandle)
 		{
 		}
 
-		public void DefineByPosition (int position, OracleConnection connection)
+		internal void DefineByPosition (int position, OracleConnection connection)
 		{
 			OciParameterDescriptor parameter = ((OciStatementHandle) Parent).GetParameter (position);
 
@@ -83,36 +83,36 @@ namespace System.Data.OracleClient.Oci
 
 		#region Properties
 
-		public OciDataType DataType {
+		internal OciDataType DataType {
 			get { return definedType; }
 		}
 
-		public Type FieldType {
+		internal Type FieldType {
 			get { return fieldType; }
 		}
 
-		public int DefinedSize {
+		internal int DefinedSize {
 			get { return definedSize; }
 		}
 
-		public OciErrorHandle ErrorHandle {
+		internal OciErrorHandle ErrorHandle {
 			get { return errorHandle; }
 			set { errorHandle = value; }
 		}
 
-		public bool IsNull {
+		internal bool IsNull {
 			get { return (indicator == -1); }
 		}
 
-		public short Scale {
+		internal short Scale {
 			get { return scale; }
 		}
 
-		public short Size {
+		internal short Size {
 			get { return rlenp; }
 		}
 
-		public IntPtr Value {
+		internal IntPtr Value {
 			get { return value; }
 		}
 
@@ -401,12 +401,12 @@ namespace System.Data.OracleClient.Oci
 			}
 		}
 
-		public OracleLob GetOracleLob ()
+		internal OracleLob GetOracleLob ()
 		{
 			return new OracleLob (lobLocator, ociType);
 		}
 
-                public object GetValue (IFormatProvider formatProvider, OracleConnection conn)
+                internal object GetValue (IFormatProvider formatProvider, OracleConnection conn)
 		{
 			object tmp;
 

+ 1 - 1
mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDescriptorHandle.cs

@@ -23,7 +23,7 @@ namespace System.Data.OracleClient.Oci {
 	{
 		#region Constructors
 
-		public OciDescriptorHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
+		internal OciDescriptorHandle (OciHandleType type, OciHandle parent, IntPtr newHandle)
 			: base (type, parent, newHandle)
 		{
 		}

+ 17 - 16
mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciHandle.cs

@@ -28,7 +28,8 @@ namespace System.Data.OracleClient.Oci {
 		#region Fields
 
 		bool disposed = false;
-		IntPtr handle = IntPtr.Zero;
+
+		protected internal IntPtr handle = IntPtr.Zero;
 		OciHandle parent = null;
 		OciHandleType type;
 
@@ -36,7 +37,7 @@ namespace System.Data.OracleClient.Oci {
 
 		#region Constructors
 
-		public OciHandle (OciHandleType type, OciHandle parent, IntPtr newHandle) {
+		internal OciHandle (OciHandleType type, OciHandle parent, IntPtr newHandle) {
 			this.type = type;
 			this.parent = parent;
 			this.handle = newHandle;
@@ -50,15 +51,15 @@ namespace System.Data.OracleClient.Oci {
 
 		#region Properties
 
-		public OciHandle Parent {
+		internal OciHandle Parent {
 			get { return parent; }
 		}
 
-		public IntPtr Handle { 
+		internal IntPtr Handle { 
 			get { return handle; }
 		}
 
-		public OciHandleType HandleType { 
+		internal OciHandleType HandleType { 
 			get { return type; }
 		}
 
@@ -66,7 +67,7 @@ namespace System.Data.OracleClient.Oci {
 
 		#region Methods
 
-		public OciHandle Allocate (OciHandleType type) {
+		internal OciHandle Allocate (OciHandleType type) {
 			int status = 0;
 			IntPtr newHandle = IntPtr.Zero;
 
@@ -150,11 +151,11 @@ namespace System.Data.OracleClient.Oci {
 			}
 		}
 
-		public bool GetAttributeBool (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal bool GetAttributeBool (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			return (GetAttributeInt32 (attrType, errorHandle) != 0);
 		}
 
-		public sbyte GetAttributeSByte (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal sbyte GetAttributeSByte (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			int status = 0;
 			sbyte output;
 
@@ -173,7 +174,7 @@ namespace System.Data.OracleClient.Oci {
 			return output;
 		}
 
-		public byte GetAttributeByte (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal byte GetAttributeByte (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			int status = 0;
 			byte output;
 
@@ -192,7 +193,7 @@ namespace System.Data.OracleClient.Oci {
 			return output;
 		}
 
-		public ushort GetAttributeUInt16 (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal ushort GetAttributeUInt16 (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			int status = 0;
 			ushort output;
 
@@ -211,7 +212,7 @@ namespace System.Data.OracleClient.Oci {
 			return output;
 		}
 
-		public int GetAttributeInt32 (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal int GetAttributeInt32 (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			int status = 0;
 			int output;
 
@@ -231,7 +232,7 @@ namespace System.Data.OracleClient.Oci {
 		}
 
 		[DllImport ("oci", EntryPoint = "OCIAttrGet")]
-		private static extern int OCIAttrGetRowIdDesc (IntPtr trgthndlp,
+		internal static extern int OCIAttrGetRowIdDesc (IntPtr trgthndlp,
 			[MarshalAs (UnmanagedType.U4)] OciHandleType trghndltyp,
 			IntPtr attributep,
 			ref uint sizep,
@@ -268,7 +269,7 @@ namespace System.Data.OracleClient.Oci {
 			return descriptor;
 		}
 
-		public IntPtr GetAttributeIntPtr (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal IntPtr GetAttributeIntPtr (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			int status = 0;
 			IntPtr output = IntPtr.Zero;
 			status = OciCalls.OCIAttrGetIntPtr (Handle,
@@ -286,7 +287,7 @@ namespace System.Data.OracleClient.Oci {
 			return output;
 		}
 
-		public string GetAttributeString (OciAttributeType attrType, OciErrorHandle errorHandle) {
+		internal string GetAttributeString (OciAttributeType attrType, OciErrorHandle errorHandle) {
 			string output = String.Empty;
 			IntPtr outputPtr = IntPtr.Zero;
 			int outSize;
@@ -313,7 +314,7 @@ namespace System.Data.OracleClient.Oci {
 			return output;
 		}
 
-		public void SetAttributeString (string attribute, OciAttributeType attrType, OciErrorHandle errorHandle) 
+		internal void SetAttributeString (string attribute, OciAttributeType attrType, OciErrorHandle errorHandle) 
 		{
 			int status = 0;
 			
@@ -330,7 +331,7 @@ namespace System.Data.OracleClient.Oci {
 			}
 		}
 
-		public void SetHandle (IntPtr h)
+		internal void SetHandle (IntPtr h)
 		{
 			handle = h;
 		}

+ 44 - 26
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleBFile.cs

@@ -26,9 +26,9 @@ namespace System.Data.OracleClient
 
 		public static readonly new OracleBFile Null = new OracleBFile ();
 
-		OracleConnection connection;
-		bool isOpen = true;
-		bool notNull;
+		//OracleConnection connection;
+		//bool isOpen;
+		//bool notNull;
 
 		#endregion // Fields
 
@@ -36,6 +36,7 @@ namespace System.Data.OracleClient
 
 		internal OracleBFile ()
 		{
+			throw new NotImplementedException ();
 		}
 
 		#endregion // Constructors
@@ -43,26 +44,38 @@ namespace System.Data.OracleClient
 		#region Properties
 
 		public override bool CanRead {
-			get { return (IsNull || isOpen); }
+			get { 
+				//return (IsNull || isOpen); 
+				throw new NotImplementedException ();
+			}
 		}
 
 		public override bool CanSeek {
-			get { return (IsNull || isOpen); }
+			get { 
+				//return (IsNull || isOpen);
+				throw new NotImplementedException ();
+			}
 		}
 
 		public override bool CanWrite {
-			get { return false; }
+			get { 
+				//return false; 
+				throw new NotImplementedException ();				
+			}
 		}
 
 		public OracleConnection Connection {
-			get { return connection; }
+			get { 				
+				//return connection; 
+				throw new NotImplementedException ();
+			}
 		}
 
 		public string DirectoryName {
 			[MonoTODO]
 			get { 
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
 				throw new NotImplementedException ();
 			}
 		}
@@ -70,10 +83,10 @@ namespace System.Data.OracleClient
 		public bool FileExists {
 			[MonoTODO]
 			get { 
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
-				if (Connection.State == ConnectionState.Closed)
-					throw new InvalidOperationException ();
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
+				//if (Connection.State == ConnectionState.Closed)
+				//	throw new InvalidOperationException ();
 				throw new NotImplementedException ();
 			}
 		}
@@ -81,23 +94,26 @@ namespace System.Data.OracleClient
 		public string FileName {
 			[MonoTODO]
 			get {
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
-				if (IsNull)
-					return String.Empty;
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
+				//if (IsNull)
+				//	return String.Empty;
 				throw new NotImplementedException ();
 			}
 		}
 
 		public bool IsNull {
-			get { return !notNull; }
+			get { 
+				//return !notNull; 
+				throw new NotImplementedException ();				
+			}
 		}
 
 		public override long Length {
 			[MonoTODO]
 			get { 
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
 				throw new NotImplementedException ();
 			}
 		}
@@ -105,16 +121,16 @@ namespace System.Data.OracleClient
 		public override long Position {
 			[MonoTODO]
 			get { 
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
 				throw new NotImplementedException ();
 			}
 			[MonoTODO]
 			set {
-				if (!isOpen)
-					throw new ObjectDisposedException ("OracleBFile");
-				if (value > Length) 
-					throw new ArgumentOutOfRangeException ();
+				//if (!isOpen)
+				//	throw new ObjectDisposedException ("OracleBFile");
+				//if (value > Length) 
+				//	throw new ArgumentOutOfRangeException ();
 				throw new NotImplementedException ();
 			}
 		}
@@ -206,3 +222,5 @@ namespace System.Data.OracleClient
 		#endregion // Methods
 	}
 }
+
+

+ 2 - 2
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleCommand.cs

@@ -307,8 +307,8 @@ namespace System.Data.OracleClient
 				newParm.Offset = parm.Offset;
 				newParm.OracleType = parm.OracleType;
 				newParm.ParameterName = parm.ParameterName;
-				newParm.Precision = parm.Precision;
-				newParm.Scale = parm.Scale;
+				//newParm.Precision = parm.Precision;
+				//newParm.Scale = parm.Scale;
 				newParm.SourceColumn = parm.SourceColumn;
 				newParm.SourceVersion = parm.SourceVersion;
 				newParm.Value = parm.Value;

+ 23 - 1
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleConnection.cs

@@ -162,7 +162,11 @@ namespace System.Data.OracleClient
 		}
 
 		[DefaultValue ("")]
+#if NET_2_0
+		[SettingsBindableAttribute (true)]
+#else
 		[RecommendedAsConfigurable (true)]
+#endif
 		[RefreshProperties (RefreshProperties.All)]
 		[Editor ("Microsoft.VSDesigner.Data.Oracle.Design.OracleConnectionStringEditor, " + Consts.AssemblyMicrosoft_VSDesigner, typeof(UITypeEditor))]
 		public
@@ -709,12 +713,30 @@ namespace System.Data.OracleClient
 				"Invalid value \"{0}\" for key '{1}'.", value, key));
 		}
 
-
 		#endregion // Methods
 
 		public event OracleInfoMessageEventHandler InfoMessage;
 #if !NET_2_0
 		public event StateChangeEventHandler StateChange;
 #endif
+
+#if NET_2_0
+		public override DataTable GetSchema ()
+		{
+			throw new NotImplementedException("GetSchema()");
+		}
+
+		public override DataTable GetSchema (String collectionName)
+		{
+			throw new NotImplementedException("GetSchema (String collectionName)");
+		}
+
+		public override DataTable GetSchema (String collectionName, string [] restrictionValues)
+		{
+			throw new NotImplementedException("GetSchema (String collectionName, string [] restrictionValues)");
+		}
+#endif
 	}
 }
+
+

+ 0 - 4
mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs

@@ -1083,8 +1083,6 @@ namespace System.Data.OracleClient
 			if (indicator == -1)
 				return;
 
-			byte[] buffer = null;
-			object tmp = null;
 			int rsize = 0;
 			IntPtr env = IntPtr.Zero;
 			StringBuilder ret = null;
@@ -1157,8 +1155,6 @@ namespace System.Data.OracleClient
 			default:
 				throw new NotImplementedException ("Data Type not implemented: " + ociType.ToString() + ".");
 			}
-			tmp = null;
-			buffer = null;
 		}
 
 		internal OciStatementHandle GetOutRefCursor (OracleCommand cmd)