Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DataKey()

System.Data.DataKey.DataKey ( DataColumn[] columns,
bool copyColumns )
inlinepackage

Definition at line 13 of file DataKey.cs.

14 {
15 if (columns == null)
16 {
17 throw ExceptionBuilder.ArgumentNull("columns");
18 }
19 if (columns.Length == 0)
20 {
21 throw ExceptionBuilder.KeyNoColumns();
22 }
23 if (columns.Length > 32)
24 {
25 throw ExceptionBuilder.KeyTooManyColumns(32);
26 }
27 for (int i = 0; i < columns.Length; i++)
28 {
29 if (columns[i] == null)
30 {
31 throw ExceptionBuilder.ArgumentNull("column");
32 }
33 }
34 for (int j = 0; j < columns.Length; j++)
35 {
36 for (int k = 0; k < j; k++)
37 {
38 if (columns[j] == columns[k])
39 {
40 throw ExceptionBuilder.KeyDuplicateColumns(columns[j].ColumnName);
41 }
42 }
43 }
44 if (copyColumns)
45 {
46 _columns = new DataColumn[columns.Length];
47 for (int l = 0; l < columns.Length; l++)
48 {
49 _columns[l] = columns[l];
50 }
51 }
52 else
53 {
54 _columns = columns;
55 }
56 CheckState();
57 }
readonly DataColumn[] _columns
Definition DataKey.cs:5

References System.Data.DataKey._columns, System.Data.ExceptionBuilder.ArgumentNull(), System.Data.DataKey.CheckState(), System.Data.ExceptionBuilder.KeyDuplicateColumns(), System.Data.ExceptionBuilder.KeyNoColumns(), and System.Data.ExceptionBuilder.KeyTooManyColumns().