Vector.Parse(String) 方法

定义

将矢量的字符串表示形式转换为等效 Vector 结构。

public:
 static System::Windows::Vector Parse(System::String ^ source);
public static System.Windows.Vector Parse(string source);
static member Parse : string -> System.Windows.Vector
Public Shared Function Parse (source As String) As Vector

参数

source
String

矢量的字符串表示形式。

返回

等效 Vector 的结构。

示例

以下示例演示如何使用此方法将矢量的字符串表示形式转换为 Vector 结构。

private Vector parseExample()
{

    // Convert string into a Vector structure.
    // vectorResult is equal to (1,3)
    Vector vectorResult = Vector.Parse("1,3");

    return vectorResult;
}
Private Function parseExample() As Vector

    ' Convert string into a Vector structure.
    ' vectorResult is equal to (1,3)
    Dim vectorResult As Vector = Vector.Parse("1,3")

    Return vectorResult

End Function

适用于

另请参阅