20 {
21 if (destinationType == null)
22 {
23 throw new ArgumentNullException("destinationType");
24 }
26 object[]
array =
null;
28 {
29 DataRelation dataRelation = (DataRelation)
value;
30 DataTable table = dataRelation.ParentKey.Table;
31 DataTable table2 = dataRelation.ChildKey.Table;
32 if (string.IsNullOrEmpty(table.Namespace) && string.IsNullOrEmpty(table2.Namespace))
33 {
34 constructorInfo = typeof(DataRelation).GetConstructor(
new Type[6]
35 {
36 typeof(string),
37 typeof(string),
38 typeof(string),
39 typeof(string[]),
40 typeof(string[]),
41 typeof(bool)
42 });
44 {
45 dataRelation.RelationName,
46 dataRelation.ParentKey.Table.TableName,
47 dataRelation.ChildKey.Table.TableName,
48 dataRelation.ParentColumnNames,
49 dataRelation.ChildColumnNames,
50 dataRelation.Nested
51 };
52 }
53 else
54 {
55 constructorInfo = typeof(DataRelation).GetConstructor(
new Type[8]
56 {
57 typeof(string),
58 typeof(string),
59 typeof(string),
60 typeof(string),
61 typeof(string),
62 typeof(string[]),
63 typeof(string[]),
64 typeof(bool)
65 });
67 {
68 dataRelation.RelationName,
69 dataRelation.ParentKey.Table.TableName,
70 dataRelation.ParentKey.Table.Namespace,
71 dataRelation.ChildKey.Table.TableName,
72 dataRelation.ChildKey.Table.Namespace,
73 dataRelation.ParentColumnNames,
74 dataRelation.ChildColumnNames,
75 dataRelation.Nested
76 };
77 }
79 }
80 return base.ConvertTo(context,
culture,
value, destinationType);
81 }