-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEbDataColumn.cs
More file actions
92 lines (75 loc) · 2.29 KB
/
EbDataColumn.cs
File metadata and controls
92 lines (75 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using ExpressBase.Common.Structures;
using ProtoBuf;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
namespace ExpressBase.Common
{
[ProtoBuf.ProtoContract]
public class EbDataColumn
{
public EbDataColumn() { }
public EbDataColumn(string columnname, EbDbTypes type)
{
this.ColumnName = columnname;
this.Type = type;
}
public EbDataColumn(int index, string columnname, EbDbTypes type)
{
this.ColumnIndex = index;
this.ColumnName = columnname;
this.Type = type;
}
[ProtoBuf.ProtoMember(1)]
public int ColumnIndex { get; set; }
[ProtoBuf.ProtoMember(2)]
public string ColumnName { get; set; }
[ProtoBuf.ProtoMember(3)]
public EbDbTypes Type { get; set; }
[ProtoBuf.ProtoMember(4)]
public string TableName { get; set; }
[ProtoBuf.ProtoMember(5)]
public string DataTypeName { get; set; }
}
[ProtoBuf.ProtoContract(IgnoreListHandling = true)]
public class ColumnColletion : List<EbDataColumn>
{
internal EbDataTable Table { get; set; }
public ColumnColletion() { }
public ColumnColletion(EbDataTable table)
{
this.Table = table;
}
public EbDataColumn this[string columnname]
{
get
{
foreach (EbDataColumn column in this)
{
if (column.ColumnName == columnname)
return column;
}
return null;
}
}
new public void Add(EbDataColumn column)
{
base.Add(column);
foreach (EbDataRow row in this.Table.Rows)
row.Add(null);
}
public void BaseAdd(EbDataColumn column)
{
base.Add(column);
}
public bool Contains(string columnName)
{
return this.Any(column => column.ColumnName != null &&
columnName != null &&
column.ColumnName.Equals(columnName, StringComparison.OrdinalIgnoreCase));
}
}
}