Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PrimaryKeyTypeConverter.cs
Go to the documentation of this file.
1
using
System.ComponentModel
;
2
using
System.Globalization
;
3
4
namespace
System.Data
;
5
6
internal
sealed
class
PrimaryKeyTypeConverter
:
ReferenceConverter
7
{
8
public
PrimaryKeyTypeConverter
()
9
: base(typeof(
DataColumn
[]))
10
{
11
}
12
13
public
override
bool
GetPropertiesSupported
(
ITypeDescriptorContext
context)
14
{
15
return
false
;
16
}
17
18
public
override
bool
CanConvertTo
(
ITypeDescriptorContext
context,
Type
destinationType)
19
{
20
if
(!(destinationType == typeof(
string
)))
21
{
22
return
base.CanConvertTo(context, destinationType);
23
}
24
return
true
;
25
}
26
27
public
override
object
ConvertTo
(
ITypeDescriptorContext
context,
CultureInfo
culture
,
object
value
,
Type
destinationType)
28
{
29
if
(destinationType ==
null
)
30
{
31
throw
new
ArgumentNullException
(
"destinationType"
);
32
}
33
if
(!(destinationType == typeof(
string
)))
34
{
35
return
base.ConvertTo(context,
culture
,
value
, destinationType);
36
}
37
return
Array
.Empty<
DataColumn
>().GetType().Name;
38
}
39
}
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.Array
Definition
Array.cs:16
System.ComponentModel.ReferenceConverter
Definition
ReferenceConverter.cs:9
System.Data.DataColumn
Definition
DataColumn.cs:24
System.Data.PrimaryKeyTypeConverter.GetPropertiesSupported
override bool GetPropertiesSupported(ITypeDescriptorContext context)
Definition
PrimaryKeyTypeConverter.cs:13
System.Data.PrimaryKeyTypeConverter.CanConvertTo
override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
Definition
PrimaryKeyTypeConverter.cs:18
System.Data.PrimaryKeyTypeConverter.PrimaryKeyTypeConverter
PrimaryKeyTypeConverter()
Definition
PrimaryKeyTypeConverter.cs:8
System.Data.PrimaryKeyTypeConverter.ConvertTo
override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
Definition
PrimaryKeyTypeConverter.cs:27
System.Data.PrimaryKeyTypeConverter
Definition
PrimaryKeyTypeConverter.cs:7
System.Globalization.CultureInfo
Definition
CultureInfo.cs:8
System.Type
Definition
Type.cs:14
System.ComponentModel.ITypeDescriptorContext
Definition
ITypeDescriptorContext.cs:4
System.ComponentModel
Definition
ColumnAttribute.cs:3
System.Data
Definition
ADP.cs:12
System.Globalization
Definition
Calendar.cs:1
System.ExceptionArgument.value
@ value
System.ExceptionArgument.culture
@ culture
source
System.Data.Common
System.Data
PrimaryKeyTypeConverter.cs
Generated by
1.10.0