ExtendedProperties.Remove 方法 (Guid)

ExtendedProperties 集合中移除 ExtendedProperty 对象。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Sub Remove ( _
    id As Guid _
)
用法
Dim instance As ExtendedProperties
Dim id As Guid

instance.Remove(id)
public void Remove(
    Guid id
)
public:
void Remove(
    Guid id
)
public void Remove(
    Guid id
)
public function Remove(
    id : Guid
)

参数

备注

此方法仅从墨迹数据的快照或对墨迹数据的引用中移除 ExtendedProperty 对象,而不从实际墨迹数据中移除 ExtendedProperty 对象。

示例

此示例检查 Strokes 集合中的每个 Stroke 对象。如果 StrokeExtendedProperties 包含与特殊时间戳 Guid 对象关联的属性,则从集合中移除该 ExtendedProperty

Private Sub RemoveAllTimeStampProperties()
    ' STROKE_START_GUID and STROKE_END_GUID
    ' are class level string const set via GUID generator
    Dim strokeStartGuid As Guid = New Guid(STROKE_START_GUID)
    Dim strokeEndGuid As Guid = New Guid(STROKE_END_GUID)

    ' access the Strokes property via using statement
    ' to insure that the object mStrokes is disposed when finished
    ' Otherwise, you will have a memory leak
    Using mStrokes As Strokes = mInkObject.Ink.Strokes
        For Each S As Stroke In mStrokes
            If S.ExtendedProperties.Contains(strokeStartGuid) Then
                S.ExtendedProperties.Remove(strokeStartGuid)
            End If
            If S.ExtendedProperties.Contains(strokeEndGuid) Then
                S.ExtendedProperties.Remove(strokeEndGuid)
            End If
        Next
    End Using
End Sub
private void RemoveAllTimeStampProperties()
{
    // STROKE_START_GUID and STROKE_END_GUID
    // are class level string const set via GUID generator
    Guid strokeStartGuid = new Guid(STROKE_START_GUID);
    Guid strokeEndGuid = new Guid(STROKE_END_GUID);

    // access the Strokes property via using statement
    // to insure that the object mStrokes is disposed when finished
    // Otherwise, you will have a memory leak
    using (Strokes mStrokes = mInkObject.Ink.Strokes)
    {
        foreach (Stroke S in mStrokes)
        {
            if (S.ExtendedProperties.Contains(strokeStartGuid))
            {
                S.ExtendedProperties.Remove(strokeStartGuid);
            }
            if (S.ExtendedProperties.Contains(strokeEndGuid))
            {
                S.ExtendedProperties.Remove(strokeEndGuid);
            }
        }
    }
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ExtendedProperties 类

ExtendedProperties 成员

Remove 重载

Microsoft.Ink 命名空间

ExtendedProperty

Ink