Copied remotely
[mono.git] / mcs / class / System.Data / System.Data.SqlClient / SqlParameter.cs
1 //
2 // System.Data.SqlClient.SqlParameter.cs
3 //
4 // Author:
5 //   Rodrigo Moya (rodrigo@ximian.com)
6 //   Daniel Morgan (danmorg@sc.rr.com)
7 //   Tim Coleman (tim@timcoleman.com)
8 //   Diego Caravana (diego@toth.it)
9 //
10 // (C) Ximian, Inc. 2002
11 // Copyright (C) Tim Coleman, 2002
12 //
13
14 //
15 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
16 //
17 // Permission is hereby granted, free of charge, to any person obtaining
18 // a copy of this software and associated documentation files (the
19 // "Software"), to deal in the Software without restriction, including
20 // without limitation the rights to use, copy, modify, merge, publish,
21 // distribute, sublicense, and/or sell copies of the Software, and to
22 // permit persons to whom the Software is furnished to do so, subject to
23 // the following conditions:
24 // 
25 // The above copyright notice and this permission notice shall be
26 // included in all copies or substantial portions of the Software.
27 // 
28 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 //
36
37 using Mono.Data.Tds;
38 using Mono.Data.Tds.Protocol;
39 using System;
40 using System.ComponentModel;
41 using System.Data;
42 using System.Data.Common;
43 #if NET_2_0
44 using System.Data.ProviderBase;
45 #endif // NET_2_0
46 using System.Runtime.InteropServices;
47 using System.Text;
48
49 namespace System.Data.SqlClient {
50         [TypeConverterAttribute (typeof (SqlParameterConverter))]
51 #if NET_2_0
52         public sealed class SqlParameter : DbParameterBase, IDbDataParameter, IDataParameter, ICloneable
53 #else
54         public sealed class SqlParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
55 #endif // NET_2_0
56         {
57                 #region Fields
58
59                 TdsMetaParameter metaParameter;
60
61                 SqlParameterCollection container = null;
62                 DbType dbType;
63                 ParameterDirection direction = ParameterDirection.Input;
64                 bool isNullable;
65                 bool isSizeSet = false;
66                 bool isTypeSet = false;
67                 int offset;
68                 SqlDbType sqlDbType;
69                 string sourceColumn;
70                 DataRowVersion sourceVersion;
71
72                 #endregion // Fields
73
74                 #region Constructors
75
76                 public SqlParameter () 
77                         : this (String.Empty, SqlDbType.NVarChar, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
78                 {
79                 }
80
81                 public SqlParameter (string parameterName, object value) 
82                 {
83                         metaParameter = new TdsMetaParameter (parameterName, value);
84                         this.sourceVersion = DataRowVersion.Current;
85                         InferSqlType (value);
86                 }
87                 
88                 public SqlParameter (string parameterName, SqlDbType dbType) 
89                         : this (parameterName, dbType, 0, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
90                 {
91                 }
92
93                 public SqlParameter (string parameterName, SqlDbType dbType, int size) 
94                         : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, String.Empty, DataRowVersion.Current, null)
95                 {
96                 }
97                 
98                 public SqlParameter (string parameterName, SqlDbType dbType, int size, string sourceColumn) 
99                         : this (parameterName, dbType, size, ParameterDirection.Input, false, 0, 0, sourceColumn, DataRowVersion.Current, null)
100                 {
101                 }
102                 
103                 [EditorBrowsable (EditorBrowsableState.Advanced)]        
104                 public SqlParameter (string parameterName, SqlDbType dbType, int size, ParameterDirection direction, bool isNullable, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, object value) 
105                 {
106                         metaParameter = new TdsMetaParameter (parameterName, size, isNullable, precision, scale, value);
107
108                         SqlDbType = dbType;
109                         Direction = direction;
110                         SourceColumn = sourceColumn;
111                         SourceVersion = sourceVersion;
112                 }
113
114                 // This constructor is used internally to construct a
115                 // SqlParameter.  The value array comes from sp_procedure_params_rowset.
116                 // This is in SqlCommand.DeriveParameters.
117                 internal SqlParameter (object[] dbValues)
118                 {
119                         Precision = 0;
120                         Scale = 0;
121                         Direction = ParameterDirection.Input;
122
123                         ParameterName = (string) dbValues[3];
124
125                         switch ((short) dbValues[5]) {
126                         case 1:
127                                 Direction = ParameterDirection.Input;
128                                 break;
129                         case 2:
130                                 Direction = ParameterDirection.Output;
131                                 break;
132                         case 3:
133                                 Direction = ParameterDirection.InputOutput;
134                                 break;
135                         case 4:
136                                 Direction = ParameterDirection.ReturnValue;
137                                 break;
138                         }
139
140                         IsNullable = (bool) dbValues[8];
141
142                         if (dbValues[12] != null)
143                                 Precision = (byte) ((short) dbValues[12]);
144                         if (dbValues[13] != null)
145                                 Scale = (byte) ((short) dbValues[13]);
146
147                         SetDbTypeName ((string) dbValues[16]);
148                 }
149
150                 #endregion // Constructors
151
152                 #region Properties
153
154                 // Used to ensure that only one collection can contain this
155                 // parameter
156                 internal SqlParameterCollection Container {
157                         get { return container; }
158                         set { container = value; }
159                 }
160
161                 [Browsable (false)]
162                 [DataCategory ("Data")]
163                 [DataSysDescription ("The parameter generic type.")]
164                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
165                 [RefreshProperties (RefreshProperties.All)]
166                 public 
167 #if NET_2_0
168                 override
169 #endif // NET_2_0
170          DbType DbType {
171                         get { return dbType; }
172                         set { 
173                                 SetDbType (value); 
174                                 isTypeSet = true;
175                         }
176                 }
177
178                 [DataCategory ("Data")]
179                 [DataSysDescription ("Input, output, or bidirectional parameter.")]
180                 [DefaultValue (ParameterDirection.Input)]
181                 public 
182 #if NET_2_0
183                 override
184 #endif // NET_2_0
185          ParameterDirection Direction {
186                         get { return direction; }
187                         set { 
188                                 direction = value; 
189                                 switch( direction ) {
190                                         case ParameterDirection.Output:
191                                         MetaParameter.Direction = TdsParameterDirection.Output;
192                                                 break;
193                                         case ParameterDirection.InputOutput:
194                                                 MetaParameter.Direction = TdsParameterDirection.InputOutput;
195                                                 break;
196                                         case ParameterDirection.ReturnValue:
197                                                 MetaParameter.Direction = TdsParameterDirection.ReturnValue;
198                                                 break;
199                                 }
200                         }
201                 }
202
203                 internal TdsMetaParameter MetaParameter {
204                         get { return metaParameter; }
205                 }
206
207                 string IDataParameter.ParameterName {
208                         get { return metaParameter.ParameterName; }
209                         set { metaParameter.ParameterName = value; }
210                 }
211
212                 [Browsable (false)]
213                 [DataSysDescription ("a design-time property used for strongly typed code-generation.")]
214                 [DefaultValue (false)]
215                 [DesignOnly (true)]
216                 [EditorBrowsable (EditorBrowsableState.Advanced)]        
217                 public 
218 #if NET_2_0
219                 override
220 #endif // NET_2_0
221          bool IsNullable        {
222                         get { return metaParameter.IsNullable; }
223                         set { metaParameter.IsNullable = value; }
224                 }
225
226                 [Browsable (false)]
227                 [DataCategory ("Data")]
228                 [DataSysDescription ("Offset in variable length data types.")]
229                 [DefaultValue (0)]
230                 public 
231 #if NET_2_0
232                 override
233 #endif // NET_2_0
234          int Offset {
235                         get { return offset; }
236                         set { offset = value; }
237                 }
238                 
239                 [DataSysDescription ("Name of the parameter, like '@p1'")]
240                 [DefaultValue ("")]
241                 public 
242 #if NET_2_0
243                 override
244 #endif // NET_2_0
245          string ParameterName {
246                         get { return metaParameter.ParameterName; }
247                         set { metaParameter.ParameterName = value; }
248                 }
249
250                 [DataCategory ("Data")]
251                 [DataSysDescription ("For decimal, numeric, varnumeric DBTypes.")]
252                 [DefaultValue (0)]
253                 public 
254 #if NET_2_0
255                 override
256 #endif // NET_2_0
257          byte Precision {
258                         get { return metaParameter.Precision; }
259                         set { metaParameter.Precision = value; }
260                 }
261
262                 [DataCategory ("Data")]
263                 [DataSysDescription ("For decimal, numeric, varnumeric DBTypes.")]
264                 [DefaultValue (0)]
265                 public 
266 #if NET_2_0
267                 override
268 #endif // NET_2_0
269          byte Scale {
270                         get { return metaParameter.Scale; }
271                         set { metaParameter.Scale = value; }
272                 }
273
274                 [DataCategory ("Data")]
275                 [DataSysDescription ("Size of variable length datatypes (strings & arrays).")]
276                 [DefaultValue (0)]
277                 public 
278 #if NET_2_0
279                 override
280 #endif // NET_2_0
281          int Size {
282                         get { return metaParameter.Size; }
283                         set { metaParameter.Size = value; }
284                 }
285
286                 [DataCategory ("Data")]
287                 [DataSysDescription ("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.")]
288                 [DefaultValue ("")]
289                 public 
290 #if NET_2_0
291                 override
292 #endif // NET_2_0
293          string SourceColumn {
294                         get { return sourceColumn; }
295                         set { sourceColumn = value; }
296                 }
297
298                 [DataCategory ("Data")]
299                 [DataSysDescription ("When used by a DataAdapter.Update (UpdateCommand only), the version of the DataRow value that is used to update the data source.")]
300                 [DefaultValue (DataRowVersion.Current)]
301                 public 
302 #if NET_2_0
303                 override
304 #endif // NET_2_0
305          DataRowVersion SourceVersion {
306                         get { return sourceVersion; }
307                         set { sourceVersion = value; }
308                 }
309                 
310                 [DataCategory ("Data")]
311                 [DataSysDescription ("The parameter native type.")]
312                 [DefaultValue (SqlDbType.NVarChar)]
313                 [RefreshProperties (RefreshProperties.All)]
314                 public SqlDbType SqlDbType {
315                         get { return sqlDbType; }
316                         set { 
317                                 SetSqlDbType (value); 
318                                 isTypeSet = true;
319                         }
320                 }
321
322                 [DataCategory ("Data")]
323                 [DataSysDescription ("Value of the parameter.")]
324                 [DefaultValue (null)]
325                 [TypeConverterAttribute (typeof (StringConverter))]
326                 public 
327 #if NET_2_0
328                 override
329 #endif // NET_2_0
330          object Value {
331                         get { return metaParameter.Value; }
332                         set { 
333                                 if (!isTypeSet)
334                                         InferSqlType (value);
335                                 metaParameter.Value = value; 
336                         }
337                 }
338
339                 #endregion // Properties
340
341                 #region Methods
342
343                 object ICloneable.Clone ()
344                 {
345                         return new SqlParameter (ParameterName, SqlDbType, Size, Direction, IsNullable, Precision, Scale, SourceColumn, SourceVersion, Value);
346                 }
347
348                 // If the value is set without the DbType/SqlDbType being set, then we
349                 // infer type information.
350                 private void InferSqlType (object value)
351                 {
352                         Type type = value.GetType ();
353
354                         string exception = String.Format ("The parameter data type of {0} is invalid.", type.Name);
355
356                         switch (type.FullName) {
357                         case "System.Int64":
358                                 SetSqlDbType (SqlDbType.BigInt);
359                                 break;
360                         case "System.Boolean":
361                                 SetSqlDbType (SqlDbType.Bit);
362                                 break;
363                         case "System.String":
364                                 SetSqlDbType (SqlDbType.NVarChar);
365                                 break;
366                         case "System.DateTime":
367                                 SetSqlDbType (SqlDbType.DateTime);
368                                 break;
369                         case "System.Decimal":
370                                 SetSqlDbType (SqlDbType.Decimal);
371                                 break;
372                         case "System.Double":
373                                 SetSqlDbType (SqlDbType.Float);
374                                 break;
375                         case "System.Byte[]":
376                                 SetSqlDbType (SqlDbType.VarBinary);
377                                 break;
378                         case "System.Byte":
379                                 SetSqlDbType (SqlDbType.TinyInt);
380                                 break;
381                         case "System.Int32":
382                                 SetSqlDbType (SqlDbType.Int);
383                                 break;
384                         case "System.Single":
385                                 SetSqlDbType (SqlDbType.Real);
386                                 break;
387                         case "System.Int16":
388                                 SetSqlDbType (SqlDbType.SmallInt);
389                                 break;
390                         case "System.Guid":
391                                 SetSqlDbType (SqlDbType.UniqueIdentifier);
392                                 break;
393                         case "System.Object":
394                                 SetSqlDbType (SqlDbType.Variant);
395                                 break;
396                         default:
397                                 throw new ArgumentException (exception);                                
398                         }
399                 }
400
401                 // When the DbType is set, we also set the SqlDbType, as well as the SQL Server
402                 // string representation of the type name.  If the DbType is not convertible
403                 // to an SqlDbType, throw an exception.
404                 private void SetDbType (DbType type)
405                 {
406                         string exception = String.Format ("No mapping exists from DbType {0} to a known SqlDbType.", type);
407
408                         switch (type) {
409                         case DbType.AnsiString:
410                                 MetaParameter.TypeName = "varchar";
411                                 sqlDbType = SqlDbType.VarChar;
412                                 break;
413                         case DbType.AnsiStringFixedLength:
414                                 MetaParameter.TypeName = "char";
415                                 sqlDbType = SqlDbType.Char;
416                                 break;
417                         case DbType.Binary:
418                                 MetaParameter.TypeName = "varbinary";
419                                 sqlDbType = SqlDbType.VarBinary;
420                                 break;
421                         case DbType.Boolean:
422                                 MetaParameter.TypeName = "bit";
423                                 sqlDbType = SqlDbType.Bit;
424                                 break;
425                         case DbType.Byte:
426                                 MetaParameter.TypeName = "tinyint";
427                                 sqlDbType = SqlDbType.TinyInt;
428                                 break;
429                         case DbType.Currency:
430                                 sqlDbType = SqlDbType.Money;
431                                 MetaParameter.TypeName = "money";
432                                 break;
433                         case DbType.Date:
434                         case DbType.DateTime:
435                                 MetaParameter.TypeName = "datetime";
436                                 sqlDbType = SqlDbType.DateTime;
437                                 break;
438                         case DbType.Decimal:
439                                 MetaParameter.TypeName = "decimal";
440                                 sqlDbType = SqlDbType.Decimal;
441                                 break;
442                         case DbType.Double:
443                                 MetaParameter.TypeName = "float";
444                                 sqlDbType = SqlDbType.Float;
445                                 break;
446                         case DbType.Guid:
447                                 MetaParameter.TypeName = "uniqueidentifier";
448                                 sqlDbType = SqlDbType.UniqueIdentifier;
449                                 break;
450                         case DbType.Int16:
451                                 MetaParameter.TypeName = "smallint";
452                                 sqlDbType = SqlDbType.SmallInt;
453                                 break;
454                         case DbType.Int32:
455                                 MetaParameter.TypeName = "int";
456                                 sqlDbType = SqlDbType.Int;
457                                 break;
458                         case DbType.Int64:
459                                 MetaParameter.TypeName = "bigint";
460                                 sqlDbType = SqlDbType.BigInt;
461                                 break;
462                         case DbType.Object:
463                                 MetaParameter.TypeName = "sql_variant";
464                                 sqlDbType = SqlDbType.Variant;
465                                 break;
466                         case DbType.Single:
467                                 MetaParameter.TypeName = "real";
468                                 sqlDbType = SqlDbType.Real;
469                                 break;
470                         case DbType.String:
471                                 MetaParameter.TypeName = "nvarchar";
472                                 sqlDbType = SqlDbType.NVarChar;
473                                 break;
474                         case DbType.StringFixedLength:
475                                 MetaParameter.TypeName = "nchar";
476                                 sqlDbType = SqlDbType.NChar;
477                                 break;
478                         case DbType.Time:
479                                 MetaParameter.TypeName = "datetime";
480                                 sqlDbType = SqlDbType.DateTime;
481                                 break;
482                         default:
483                                 throw new ArgumentException (exception);
484                         }
485                         dbType = type;
486                 }
487
488                 // Used by internal constructor which has a SQL Server typename
489                 private void SetDbTypeName (string dbTypeName)
490                 {
491                         switch (dbTypeName.ToLower ()) {        
492                         case "bigint":
493                                 SqlDbType = SqlDbType.BigInt;
494                                 break;
495                         case "binary":
496                                 SqlDbType = SqlDbType.Binary;
497                                 break;
498                         case "bit":
499                                 SqlDbType = SqlDbType.Bit;
500                                 break;
501                         case "char":
502                                 SqlDbType = SqlDbType.Char;
503                                 break;
504                         case "datetime":
505                                 SqlDbType = SqlDbType.DateTime;
506                                 break;
507                         case "decimal":
508                                 SqlDbType = SqlDbType.Decimal;
509                                 break;
510                         case "float":
511                                 SqlDbType = SqlDbType.Float;
512                                 break;
513                         case "image":
514                                 SqlDbType = SqlDbType.Image;
515                                 break;
516                         case "int":
517                                 SqlDbType = SqlDbType.Int;
518                                 break;
519                         case "money":
520                                 SqlDbType = SqlDbType.Money;
521                                 break;
522                         case "nchar":
523                                 SqlDbType = SqlDbType.NChar;
524                                 break;
525                         case "ntext":
526                                 SqlDbType = SqlDbType.NText;
527                                 break;
528                         case "nvarchar":
529                                 SqlDbType = SqlDbType.NVarChar;
530                                 break;
531                         case "real":
532                                 SqlDbType = SqlDbType.Real;
533                                 break;
534                         case "smalldatetime":
535                                 SqlDbType = SqlDbType.SmallDateTime;
536                                 break;
537                         case "smallint":
538                                 SqlDbType = SqlDbType.SmallInt;
539                                 break;
540                         case "smallmoney":
541                                 SqlDbType = SqlDbType.SmallMoney;
542                                 break;
543                         case "text":
544                                 SqlDbType = SqlDbType.Text;
545                                 break;
546                         case "timestamp":
547                                 SqlDbType = SqlDbType.Timestamp;
548                                 break;
549                         case "tinyint":
550                                 SqlDbType = SqlDbType.TinyInt;
551                                 break;
552                         case "uniqueidentifier":
553                                 SqlDbType = SqlDbType.UniqueIdentifier;
554                                 break;
555                         case "varbinary":
556                                 SqlDbType = SqlDbType.VarBinary;
557                                 break;
558                         case "varchar":
559                                 SqlDbType = SqlDbType.VarChar;
560                                 break;
561                         default:
562                                 SqlDbType = SqlDbType.Variant;
563                                 break;
564                         }
565                 }
566
567                 // When the SqlDbType is set, we also set the DbType, as well as the SQL Server
568                 // string representation of the type name.  If the SqlDbType is not convertible
569                 // to a DbType, throw an exception.
570                 private void SetSqlDbType (SqlDbType type)
571                 {
572                         string exception = String.Format ("No mapping exists from SqlDbType {0} to a known DbType.", type);
573
574                         switch (type) {
575                         case SqlDbType.BigInt:
576                                 MetaParameter.TypeName = "bigint";
577                                 dbType = DbType.Int64;
578                                 break;
579                         case SqlDbType.Binary:
580                                 MetaParameter.TypeName = "binary";
581                                 dbType = DbType.Binary;
582                                 break;
583                         case SqlDbType.Timestamp:
584                                 MetaParameter.TypeName = "timestamp";
585                                 dbType = DbType.Binary;
586                                 break;
587                         case SqlDbType.VarBinary:
588                                 MetaParameter.TypeName = "varbinary";
589                                 dbType = DbType.Binary;
590                                 break;
591                         case SqlDbType.Bit:
592                                 MetaParameter.TypeName = "bit";
593                                 dbType = DbType.Boolean;
594                                 break;
595                         case SqlDbType.Char:
596                                 MetaParameter.TypeName = "char";
597                                 dbType = DbType.AnsiStringFixedLength;
598                                 break;
599                         case SqlDbType.DateTime:
600                                 MetaParameter.TypeName = "datetime";
601                                 dbType = DbType.DateTime;
602                                 break;
603                         case SqlDbType.SmallDateTime:
604                                 MetaParameter.TypeName = "smalldatetime";
605                                 dbType = DbType.DateTime;
606                                 break;
607                         case SqlDbType.Decimal:
608                                 MetaParameter.TypeName = "decimal";
609                                 dbType = DbType.Decimal;
610                                 break;
611                         case SqlDbType.Float:
612                                 MetaParameter.TypeName = "float";
613                                 dbType = DbType.Double;
614                                 break;
615                         case SqlDbType.Image:
616                                 MetaParameter.TypeName = "image";
617                                 dbType = DbType.Binary;
618                                 break;
619                         case SqlDbType.Int:
620                                 MetaParameter.TypeName = "int";
621                                 dbType = DbType.Int32;
622                                 break;
623                         case SqlDbType.Money:
624                                 MetaParameter.TypeName = "money";
625                                 dbType = DbType.Currency;
626                                 break;
627                         case SqlDbType.SmallMoney:
628                                 MetaParameter.TypeName = "smallmoney";
629                                 dbType = DbType.Currency;
630                                 break;
631                         case SqlDbType.NChar:
632                                 MetaParameter.TypeName = "nchar";
633                                 dbType = DbType.StringFixedLength;
634                                 break;
635                         case SqlDbType.NText:
636                                 MetaParameter.TypeName = "ntext";
637                                 dbType = DbType.String;
638                                 break;
639                         case SqlDbType.NVarChar:
640                                 MetaParameter.TypeName = "nvarchar";
641                                 dbType = DbType.String;
642                                 break;
643                         case SqlDbType.Real:
644                                 MetaParameter.TypeName = "real";
645                                 dbType = DbType.Single;
646                                 break;
647                         case SqlDbType.SmallInt:
648                                 MetaParameter.TypeName = "smallint";
649                                 dbType = DbType.Int16;
650                                 break;
651                         case SqlDbType.Text:
652                                 MetaParameter.TypeName = "text";
653                                 dbType = DbType.AnsiString;
654                                 break;
655                         case SqlDbType.VarChar:
656                                 MetaParameter.TypeName = "varchar";
657                                 dbType = DbType.AnsiString;
658                                 break;
659                         case SqlDbType.TinyInt:
660                                 MetaParameter.TypeName = "tinyint";
661                                 dbType = DbType.Byte;
662                                 break;
663                         case SqlDbType.UniqueIdentifier:
664                                 MetaParameter.TypeName = "uniqueidentifier";
665                                 dbType = DbType.Guid;
666                                 break;
667                         case SqlDbType.Variant:
668                                 MetaParameter.TypeName = "sql_variant";
669                                 dbType = DbType.Object;
670                                 break;
671                         default:
672                                 throw new ArgumentException (exception);
673                         }
674                         sqlDbType = type;
675                 }
676
677                 public override string ToString() 
678                 {
679                         return ParameterName;
680                 }
681
682 #if NET_2_0
683                 [MonoTODO]
684                 public override void CopyTo (DbParameter param)
685                 {
686                         throw new NotImplementedException ();
687                 }
688                 
689                 [MonoTODO]
690                 public override void ResetDbType ()
691                 {
692                         throw new NotImplementedException ();
693                 }
694 #endif // NET_2_0
695
696                 #endregion // Methods
697         }
698 }