Stroke.AddPropertyData(Guid, Object) 메서드

정의

Stroke 개체에 사용자 지정 속성을 추가합니다.

public:
 void AddPropertyData(Guid propertyDataId, System::Object ^ propertyData);
public void AddPropertyData (Guid propertyDataId, object propertyData);
member this.AddPropertyData : Guid * obj -> unit
Public Sub AddPropertyData (propertyDataId As Guid, propertyData As Object)

매개 변수

propertyDataId
Guid

속성의 고유 식별자입니다.

propertyData
Object

사용자 지정 속성의 값입니다. propertyData는 허용되지 않는 String을 제외하고, Char, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, Double, DateTime, Boolean, String, Decimal 또는 이러한 데이터 형식의 배열이어야 합니다.

예외

propertyData 인수가 Parameters 섹션에 나열된 허용되는 데이터 형식 중 하나가 아닌 경우

예제

다음 예제에서는 사용자 지정 속성을 추가 하는 방법에 설명 된 Stroke 개체입니다.

// Create a guid for the date/timestamp.
Guid dtGuid = new Guid("03457307-3475-3450-3035-640435034540");

DateTime now = DateTime.Now;

// Check whether the property is already saved
if (thisStroke.ContainsPropertyData(dtGuid))
{
    // Check whether the existing property matches the current date/timestamp
    DateTime oldDT = (DateTime)thisStroke.GetPropertyData(dtGuid);

    if (oldDT != now)
    {
        // Update the current date and time
        thisStroke.AddPropertyData(dtGuid, now);
    }
}
' Create a guid for the date/timestamp.
Dim dtGuid As New Guid("03457307-3475-3450-3035-640435034540")

Dim now As DateTime = DateTime.Now

' Check whether the property is already saved
If thisStroke.ContainsPropertyData(dtGuid) Then
    ' Check whether the existing property matches the current date/timestamp
    Dim oldDT As DateTime = CType(thisStroke.GetPropertyData(dtGuid), DateTime)

    If oldDT <> now Then
        ' Update the current date and time
        thisStroke.AddPropertyData(dtGuid, now)
    End If
End If

설명

이 메서드는 추가 정보를 저장 하는 경우에 유용 합니다 Stroke합니다.

적용 대상

추가 정보