Chỉnh sửa

VectorConverter Class

Definition

Converts instances of other types to and from a Vector.

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

Examples

The following example uses a VectorConverter to convert a string into a Vector.

private Vector vectorConverterExample()
{
    VectorConverter vConverter = new VectorConverter();
    Vector vectorResult = new Vector();
    string string1 = "10,20";

    vectorResult = (Vector)vConverter.ConvertFromString(string1);
    // vectorResult is equal to (10, 20)

    return vectorResult;
}

Constructors

Name Description
VectorConverter()

Initializes a new instance of the Vector structure.

Methods

Name Description
CanConvertFrom(ITypeDescriptorContext, Type)

Indicates whether an object can be converted from a given type to an instance of a Vector.

CanConvertTo(ITypeDescriptorContext, Type)

Determines whether instances of Vector can be converted to the specified type.

ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Converts the specified object to a Vector.

ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Converts the specified Vector to the specified type.

Applies to

See also