Editja

PointConverter Class

Definition

Converts instances of other types to and from a Point.

public ref class PointConverter sealed : System::ComponentModel::TypeConverter
public sealed class PointConverter : System.ComponentModel.TypeConverter
type PointConverter = class
    inherit TypeConverter
Public NotInheritable Class PointConverter
Inherits TypeConverter
Inheritance
PointConverter

Examples

The following code example uses a PointConverter to convert a string into a Point.

private Point pointConverterExample()
{
    PointConverter pConverter = new PointConverter();
    Point pointResult = new Point();
    string string1 = "10,20";

    // pointResult is equal to (10, 20)
    pointResult = (Point)pConverter.ConvertFromString(string1);

    return pointResult;
}

Constructors

Name Description
PointConverter()

Initializes a new instance of the PointConverter class.

Methods

Name Description
CanConvertFrom(ITypeDescriptorContext, Type)

Determines whether an object can be converted from a given type to an instance of a Point.

CanConvertTo(ITypeDescriptorContext, Type)

Determines whether an instance of a Point can be converted to a different type.

ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Attempts to convert the specified object to a Point.

ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Attempts to convert a Point to a specified type.

Applies to

See also