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는 허용되지 않는 경우를 제외하고 이러한 데이터 형식의 CharByteInt16UInt16Int32UInt32Int64UInt64SingleDoubleDateTimeBooleanStringDecimal 배열, 또는 이러한 데이터 형식의 배열이어야 합니다.String

예외

인수는 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저장해야 하는 경우에 유용합니다.

적용 대상

추가 정보