2002-10-22 Tim Coleman (tim@timcoleman.com)
[mono.git] / mcs / class / Mono.Data.TdsClient / Mono.Data.TdsClient.Internal / TdsPacketEndTokenResult.cs
1 //
2 // Mono.Data.TdsClient.Internal.TdsPacketEndTokenResult.cs
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
9
10 using System;
11 using System.Data;
12
13 namespace Mono.Data.TdsClient.Internal {
14         internal class TdsPacketEndTokenResult : TdsPacketResult
15         {
16
17                 #region Fields
18
19                 byte status;
20                 int rowCount;
21                 bool isRetStatSet;
22                 int retStat;
23
24                 #endregion // Fields
25
26                 #region Constructors
27
28                 public TdsPacketEndTokenResult (TdsPacketSubType type, byte status, int rowCount)
29                         : base (type)
30                 {
31                         if (type == TdsPacketSubType.DoneInProc)
32                                 throw new TdsException ("");
33                         this.status = status;
34                         this.rowCount = rowCount;
35                         this.isRetStatSet = false;
36                 }
37
38                 #endregion // Constructors
39
40                 #region Properties
41
42                 public int RowCount {
43                         get { return rowCount; }
44                 }
45
46                 public bool MoreResults {
47                         get { return (status & 0x01) != 0; }
48                 }
49                 
50                 public bool Cancelled {
51                         get { return (status & 0x20) != 0; }
52                 }
53
54                 public bool ReturnStatusExists {
55                         get { return isRetStatSet; }
56                 }
57
58                 public int ReturnStatus {
59                         get { return retStat; }
60                         set { 
61                                 isRetStatSet = true;
62                                 retStat = value;
63                         }
64                 }
65
66                 #endregion // Properties
67
68                 #region Methods
69
70                 [MonoTODO]
71                 public override string ToString ()
72                 {
73                         throw new NotImplementedException ();
74                 }       
75
76                 #endregion // Methods
77         }
78 }