Author: gert
Date: 2007-07-01 08:36:38 -0400 (Sun, 01 Jul 2007)
New Revision: 81141

Modified:
   trunk/mcs/class/System.Data/System.Data.OleDb/ChangeLog
   trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs
   trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs
Log:
* OleDbParameter.cs: Code formatting.
* OleDbParameterCollection.cs: Code formatting.


Modified: trunk/mcs/class/System.Data/System.Data.OleDb/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.OleDb/ChangeLog     2007-07-01 
12:32:16 UTC (rev 81140)
+++ trunk/mcs/class/System.Data/System.Data.OleDb/ChangeLog     2007-07-01 
12:36:38 UTC (rev 81141)
@@ -1,3 +1,8 @@
+2007-07-01  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * OleDbParameter.cs: Code formatting.
+       * OleDbParameterCollection.cs: Code formatting.
+
 2007-06-21  Nagappan A  <[EMAIL PROTECTED]>
 
        * OleDbConnection.cs: Fixed compiler warning.

Modified: trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs     
2007-07-01 12:32:16 UTC (rev 81140)
+++ trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs     
2007-07-01 12:36:38 UTC (rev 81141)
@@ -55,8 +55,7 @@
                ParameterDirection direction;
                OleDbType oleDbType;
                DbType dbType;
-               OleDbParameterCollection container = null;              
-
+               OleDbParameterCollection container;
                IntPtr gdaParameter;
 
                #endregion
@@ -66,7 +65,6 @@
                public OleDbParameter ()
                {
                        name = String.Empty;
-                       value = null;
                        size = 0;
                        isNullable = true;
                        precision = 0;
@@ -102,7 +100,7 @@
                        this.sourceColumn = srcColumn;
                }
                
-               [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]      
        
+               [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
                public OleDbParameter(string name, OleDbType dataType, int 
size, ParameterDirection direction, bool isNullable, byte precision, byte 
scale, string srcColumn, DataRowVersion srcVersion, object value)
                        : this (name, dataType, size, srcColumn)
                {
@@ -148,7 +146,7 @@
                [DataSysDescriptionAttribute ("a design-time property used for 
strongly typed code-generation.")]
 #endif
                [DesignOnlyAttribute (true)]
-                [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
+               [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
                [DefaultValue (false)]
                public bool IsNullable {
                        get { return isNullable; }
@@ -180,7 +178,7 @@
 
                [DefaultValue (0)]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("For decimal, numeric, 
varnumeric DBTypes.")]
+               [DataSysDescriptionAttribute ("For decimal, numeric, varnumeric 
DBTypes.")]
 #endif
                [DataCategory ("DataCategory_Data")]
                public byte Precision {
@@ -190,7 +188,7 @@
                
                [DefaultValue (0)]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("For decimal, numeric, 
varnumeric DBTypes.")]
+               [DataSysDescriptionAttribute ("For decimal, numeric, varnumeric 
DBTypes.")]
 #endif
                [DataCategory ("DataCategory_Data")]
                public byte Scale {
@@ -201,7 +199,7 @@
 
                [DefaultValue (0)]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("Size of variable length data 
types (string & arrays).")]
+               [DataSysDescriptionAttribute ("Size of variable length data 
types (string & arrays).")]
 #endif
                [DataCategory ("DataCategory_Data")]
                public int Size {
@@ -211,7 +209,7 @@
 
                [DefaultValue ("")]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("When used by a 
DataAdapter.Update, the source column name that is used to find the 
DataSetColumn name in the ColumnMappings. This is to copy a value between the 
parameter and a datarow.")]
+               [DataSysDescriptionAttribute ("When used by a 
DataAdapter.Update, the source column name that is used to find the 
DataSetColumn name in the ColumnMappings. This is to copy a value between the 
parameter and a datarow.")]
 #endif
                [DataCategory ("DataCategory_Data")]
                public string SourceColumn {
@@ -221,7 +219,7 @@
                
                [DefaultValue (DataRowVersion.Current)]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("When used by a 
DataAdapter.Update (UpdateCommand only), the version of the DataRow value that 
is used to update the data source.")]
+               [DataSysDescriptionAttribute ("When used by a 
DataAdapter.Update (UpdateCommand only), the version of the DataRow value that 
is used to update the data source.")]
 #endif
                [DataCategory ("DataCategory_Data")]
                public DataRowVersion SourceVersion {
@@ -231,7 +229,7 @@
                
                [DefaultValue (null)]
 #if !NET_2_0
-                [DataSysDescriptionAttribute ("Value of the parameter.")]
+               [DataSysDescriptionAttribute ("Value of the parameter.")]
 #endif
                [TypeConverter (typeof (StringConverter))]
                [DataCategory ("DataCategory_Data")]
@@ -241,13 +239,12 @@
                }
 
                // Used to ensure that only one collection can contain this
-                // parameter
-                internal OleDbParameterCollection Container {
-                        get { return container; }
-                        set { container = value; }
-                }
+               // parameter
+               internal OleDbParameterCollection Container {
+                       get { return container; }
+                       set { container = value; }
+               }
 
-
                #endregion // Properties
 
                #region Internal Properties

Modified: 
trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs   
2007-07-01 12:32:16 UTC (rev 81140)
+++ trunk/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs   
2007-07-01 12:36:38 UTC (rev 81141)
@@ -41,8 +41,8 @@
 
 namespace System.Data.OleDb
 {
-        [ListBindable (false)]
-        [EditorAttribute 
("Microsoft.VSDesigner.Data.Design.DBParametersEditor, "+ 
Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ 
Consts.AssemblySystem_Drawing )]
+       [ListBindable (false)]
+       [EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBParametersEditor, 
"+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ 
Consts.AssemblySystem_Drawing)]
        public sealed class OleDbParameterCollection : MarshalByRefObject,
                IDataParameterCollection, IList, ICollection, IEnumerable
        {
@@ -53,40 +53,42 @@
                #endregion // Fields
 
                #region Constructors
-                                                                               
                     
-                internal OleDbParameterCollection () {
-                }
-                                                                               
                     
-                #endregion // Constructors
+
+               internal OleDbParameterCollection ()
+               {
+               }
+
+               #endregion // Constructors
        
                #region Properties
                
                [Browsable (false)]
-                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
+               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                public int Count {
                        get { return list.Count; }
                }
                
                [Browsable (false)]
-                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
+               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                public OleDbParameter this[int index] {
                        get { return (OleDbParameter) list[index]; }
                        set { list[index] = value; }
                }
 
                [Browsable (false)]
-                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
+               [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                public OleDbParameter this[string parameterName] {
                        get {
-                                foreach (OleDbParameter p in list)
-                                        if (p.ParameterName.Equals 
(parameterName))
-                                                return p; 
-                               throw new IndexOutOfRangeException ("The 
specified name does not exist: " + parameterName);
-                        }
-                        set {
-                                if (!Contains (parameterName))                 
                                                                        throw 
new IndexOutOfRangeException("The specified name does not exist: " + 
parameterName);
-                                this [IndexOf (parameterName)] = value;
-                        }                                                      
                                     
+                               foreach (OleDbParameter p in list)
+                                       if (p.ParameterName.Equals 
(parameterName))
+                                               return p; 
+                               throw new IndexOutOfRangeException ("The 
specified name does not exist: " + parameterName);
+                       }
+                       set {
+                               if (!Contains (parameterName))
+                                       throw new IndexOutOfRangeException("The 
specified name does not exist: " + parameterName);
+                               this [IndexOf (parameterName)] = value;
+                       }
                }
 
                bool IList.IsFixedSize {
@@ -110,8 +112,7 @@
                        set { list[index] = value; }
                }
 
-               object IDataParameterCollection.this[string name]
-               {
+               object IDataParameterCollection.this[string name] {
                        [MonoTODO]
                        get {
                                throw new NotImplementedException ();
@@ -138,21 +139,21 @@
 
                #region Methods
                
-                public int Add (object value) {
-                         if (!(value is OleDbParameter))
-                                throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");                      
-                        Add ((OleDbParameter) value);                      
-                        return IndexOf (value);
-                }
-                                                                               
                     
+               public int Add (object value)
+               {
+                       if (!(value is OleDbParameter))
+                               throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");
+                       Add ((OleDbParameter) value);
+                       return IndexOf (value);
+               }
+
                public OleDbParameter Add (OleDbParameter parameter)
                {
-                         if (parameter.Container != null)
-                                throw new ArgumentException ("The 
OleDbParameter specified in the value parameter is already added to this or 
another OleDbParameterCollection.");
-                                                                               
                     
-                        parameter.Container = this;
-                        list.Add (parameter);
-                        return parameter;
+                       if (parameter.Container != null)
+                               throw new ArgumentException ("The 
OleDbParameter specified in the value parameter is already added to this or 
another OleDbParameterCollection.");
+                       parameter.Container = this;
+                       list.Add (parameter);
+                       return parameter;
                }
 
 #if NET_2_0
@@ -160,18 +161,18 @@
 #endif
                public OleDbParameter Add (string name, object value)
                {
-                       return Add (new OleDbParameter (name, value));  
+                       return Add (new OleDbParameter (name, value));
                }
 
 #if NET_2_0
-                public OleDbParameter AddWithValue (string parameterName, 
object value)
-                {
+               public OleDbParameter AddWithValue (string parameterName, 
object value)
+               {
                        return Add (new OleDbParameter (parameterName, value));
                }
 #endif // NET_2_0
 
                public OleDbParameter Add (string name, OleDbType type)
-               {
+               {
                        return Add (new OleDbParameter (name, type));
                }
 
@@ -180,83 +181,79 @@
                        return Add (new OleDbParameter (name, type, width));
                }
 
-               public OleDbParameter Add (string name, OleDbType type,
-                                          int width, string src_col)
+               public OleDbParameter Add (string name, OleDbType type, int 
width, string src_col)
                {
                        return Add (new OleDbParameter (name, type, width, 
src_col));
                }
 
-               public void Clear() {
-                       
+               public void Clear()
+               {
                        foreach (OleDbParameter p in list)
-                                p.Container = null;
-                                                                               
                     
-                        list.Clear ();
-                }
+                               p.Container = null;
+                       list.Clear ();
+               }
 
-               public bool Contains (object value) {
-       
-                       if (!(value is OleDbParameter))
-                                throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");
-                        return Contains (((OleDbParameter) 
value).ParameterName);
-                }
-                                                                               
                     
-                public bool Contains (string value) {
-                
-                        foreach (OleDbParameter p in list)
-                                if (p.ParameterName.Equals (value))
-                                        return true;
-                        return false;
-                }
-                                                                               
                     
-                public void CopyTo (Array array, int index) {
-                
-                        list.CopyTo (array, index);
-                }
-                                                                               
                     
-                public IEnumerator GetEnumerator() {
-                
-                        return list.GetEnumerator ();
-                }
-               
-               public int IndexOf (object value) {
-                
-                        if (!(value is OleDbParameter))
-                                throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");
-                        return IndexOf (((OleDbParameter) 
value).ParameterName);
-                }
-                                                                               
                     
-                public int IndexOf (string parameterName) {
-                
-                        for (int i = 0; i < Count; i += 1)
-                                if (this [i].ParameterName.Equals 
(parameterName))
-                                        return i;
-                        return -1;
-                }
-                                                                               
                     
-                public void Insert (int index, object value) {
-                
-                        list.Insert (index, value);
-                }
-                                                                               
                     
-                public void Remove (object value) {
-                
-                        ((OleDbParameter) value).Container = null;
-                        list.Remove (value);
-                }
-                                                                               
                     
-                public void RemoveAt (int index) {
-                
-                        this [index].Container = null;
-                        list.RemoveAt (index);
-                }
-               
-               public void RemoveAt (string parameterName) {
-                
-                        RemoveAt (IndexOf (parameterName));
-                }
+               public bool Contains (object value)
+               {
+                       if (!(value is OleDbParameter))
+                               throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");
+                       return Contains (((OleDbParameter) 
value).ParameterName);
+               }
 
+               public bool Contains (string value)
+               {
+                       foreach (OleDbParameter p in list)
+                               if (p.ParameterName.Equals (value))
+                                       return true;
+                       return false;
+               }
 
+               public void CopyTo (Array array, int index)
+               {
+                       list.CopyTo (array, index);
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator ();
+               }
+
+               public int IndexOf (object value)
+               {
+                       if (!(value is OleDbParameter))
+                               throw new InvalidCastException ("The parameter 
was not an OleDbParameter.");
+                       return IndexOf (((OleDbParameter) value).ParameterName);
+               }
+
+               public int IndexOf (string parameterName)
+               {
+                       for (int i = 0; i < Count; i += 1)
+                               if (this [i].ParameterName.Equals 
(parameterName))
+                                       return i;
+                       return -1;
+               }
+
+               public void Insert (int index, object value)
+               {
+                       list.Insert (index, value);
+               }
+
+               public void Remove (object value)
+               {
+                       ((OleDbParameter) value).Container = null;
+                       list.Remove (value);
+               }
+
+               public void RemoveAt (int index) {
+                       this [index].Container = null;
+                       list.RemoveAt (index);
+               }
+
+               public void RemoveAt (string parameterName)
+               {
+                       RemoveAt (IndexOf (parameterName));
+               }
+
                #endregion // Methods
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to