Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.Data / System / Data / Common / dbdatarecord.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="DbDataRecord.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
8
9 namespace System.Data.Common {
10
11     using System.ComponentModel;
12
13     public abstract class DbDataRecord : ICustomTypeDescriptor, IDataRecord {
14
15         protected DbDataRecord() : base() {
16         }
17
18         public abstract int FieldCount {
19             get;
20         }
21
22         public abstract object this[int i] {
23             get;
24         }
25
26         public abstract object this[string name] {
27             get;
28         }
29
30         public abstract bool GetBoolean(int i);
31
32         public abstract byte GetByte(int i);
33
34         public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
35
36         public abstract char GetChar(int i);
37
38         public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
39
40         public IDataReader GetData(int i) {
41             return GetDbDataReader(i);
42         }
43
44         virtual protected DbDataReader GetDbDataReader(int i) {
45             // NOTE: This method is virtual because we're required to implement
46             //       it however most providers won't support it. Only the OLE DB 
47             //       provider supports it right now, and they can override it.
48             throw ADP.NotSupported();
49         }
50
51         public abstract string GetDataTypeName(int i);
52
53         public abstract DateTime GetDateTime(int i);
54
55         public abstract Decimal GetDecimal(int i);
56
57         public abstract double GetDouble(int i);
58
59         public abstract Type GetFieldType(int i);
60
61         public abstract float GetFloat(int i);
62
63         public abstract Guid GetGuid(int i);
64
65         public abstract Int16 GetInt16(int i);
66
67         public abstract Int32 GetInt32(int i);
68
69         public abstract Int64 GetInt64(int i);
70
71         public abstract string GetName(int i);
72
73         public abstract int GetOrdinal(string name);
74
75         public abstract string GetString(int i);
76
77         public abstract object GetValue(int i);
78
79         public abstract int GetValues(object[] values);
80
81         public abstract bool IsDBNull(int i);
82
83         //
84         // ICustomTypeDescriptor
85         //
86
87         AttributeCollection ICustomTypeDescriptor.GetAttributes() {
88             return new AttributeCollection((Attribute[])null);
89
90         }
91
92         string ICustomTypeDescriptor.GetClassName() {
93             return null;
94         }
95
96         string ICustomTypeDescriptor.GetComponentName() {
97             return null;
98         }
99
100         TypeConverter ICustomTypeDescriptor.GetConverter() {
101             return null;
102         }
103
104         EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() {
105             return null;
106         }
107
108
109         PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() {
110             return null;
111         }
112
113         object ICustomTypeDescriptor.GetEditor(Type editorBaseType) {
114             return null;
115         }
116
117         EventDescriptorCollection ICustomTypeDescriptor.GetEvents() {
118             return new EventDescriptorCollection(null);
119         }
120
121         EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) {
122             return new EventDescriptorCollection(null);
123         }
124
125         PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() {
126             return((ICustomTypeDescriptor)this).GetProperties(null);
127         }
128
129         PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) {
130             return new PropertyDescriptorCollection(null);
131         }
132
133         object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) {
134             return this;
135         }
136     }
137 }