C# 클래스 EnumDescriptionConverter, gert

EnumConverter supporting System.ComponentModel.DescriptionAttribute
상속: System.ComponentModel.EnumConverter
파일 보기 프로젝트 열기: mono/gert 1 사용 예제들

공개 메소드들

메소드 설명
ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object

Converts the given object to the type of this converter, using the specified context and culture information.

This member overrides TypeConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, object).

ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object

Converts the given value object to the specified type, using the specified context and culture information.

This member overrides TypeConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type).

EnumDescriptionConverter ( System type ) : System

Constructs EnumDescriptionConverter for a given Enum

GetEnumDescription ( Enum value ) : string

Gets the Description of the given Enumeration value

GetEnumDescription ( System value, string name ) : string

Gets the Description of a named value in an Enumeration

GetEnumValue ( System value, string description ) : object

Gets the value of an Enum, based on it's Description Attribute or named value

메소드 상세

ConvertFrom() 공개 메소드

Converts the given object to the type of this converter, using the specified context and culture information.

This member overrides TypeConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, object).

public ConvertFrom ( ITypeDescriptorContext context, CultureInfo culture, object value ) : object
context ITypeDescriptorContext An that provides a format context.
culture CultureInfo A object. If a is passed, the current culture is assumed.
value object The to convert.
리턴 object

ConvertTo() 공개 메소드

Converts the given value object to the specified type, using the specified context and culture information.

This member overrides TypeConverter.ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type).

public ConvertTo ( ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType ) : object
context ITypeDescriptorContext An that provides a format context.
culture CultureInfo A object. If a is passed, the current culture is assumed.
value object The to convert.
destinationType Type The to convert the parameter to.
리턴 object

EnumDescriptionConverter() 공개 메소드

Constructs EnumDescriptionConverter for a given Enum
public EnumDescriptionConverter ( System type ) : System
type System
리턴 System

GetEnumDescription() 공개 정적인 메소드

Gets the Description of the given Enumeration value
public static GetEnumDescription ( Enum value ) : string
value Enum The enumeration value
리턴 string

GetEnumDescription() 공개 정적인 메소드

Gets the Description of a named value in an Enumeration
public static GetEnumDescription ( System value, string name ) : string
value System The type of the Enumeration
name string The name of the Enumeration value
리턴 string

GetEnumValue() 공개 정적인 메소드

Gets the value of an Enum, based on it's Description Attribute or named value
public static GetEnumValue ( System value, string description ) : object
value System The Enum type
description string The description or name of the element
리턴 object