PointConverter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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. |