Stroke.RemovePropertyData(Guid) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
刪除 Stroke 物件中的自訂屬性。
public:
void RemovePropertyData(Guid propertyDataId);
public void RemovePropertyData (Guid propertyDataId);
member this.RemovePropertyData : Guid -> unit
Public Sub RemovePropertyData (propertyDataId As Guid)
參數
- propertyDataId
- Guid
屬性的唯一識別項。
範例
下列範例示範如何從 Stroke 物件中刪除自訂屬性。
// Create a guid for the date/timestamp.
Guid dateTimeGuid = new Guid("03457307-3475-3450-3035-045430534046");
DateTime current = DateTime.Now;
// Check whether the property is already saved
if (thisStroke.ContainsPropertyData(dateTimeGuid))
{
DateTime oldDateTime = (DateTime)thisStroke.GetPropertyData(dateTimeGuid);
// Check whether the existing property matches the current date/timestamp
if (!(oldDateTime == current))
{
// Delete the custom property
thisStroke.RemovePropertyData(dateTimeGuid);
}
}
' Create a guid for the date/timestamp.
Dim dateTimeGuid As New Guid("03457307-3475-3450-3035-045430534046")
Dim current As DateTime = DateTime.Now
' Check whether the property is already saved
If thisStroke.ContainsPropertyData(dateTimeGuid) Then
Dim oldDateTime As DateTime = CType(thisStroke.GetPropertyData(dateTimeGuid), DateTime)
' Check whether the existing property matches the current date/timestamp
If Not oldDateTime = current Then
' Delete the custom property
thisStroke.RemovePropertyData(dateTimeGuid)
End If
End If