Stroke.ContainsPropertyData(Guid) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a value that indicates whether the Stroke object contains the specified custom property.
public:
bool ContainsPropertyData(Guid propertyDataId);
public bool ContainsPropertyData (Guid propertyDataId);
member this.ContainsPropertyData : Guid -> bool
Public Function ContainsPropertyData (propertyDataId As Guid) As Boolean
Parameters
- propertyDataId
- Guid
The unique identifier for the property.
Returns
Returns true
if the custom property exists; otherwise, returns false
.
Examples
The following example demonstrates how to determine whether a Stroke object has a custom property.
// 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
Applies to
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應