Ink.ExtendedProperties 属性

获取应用程序定义的数据的集合。

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

语法

声明
Public ReadOnly Property ExtendedProperties As ExtendedProperties
用法
Dim instance As Ink
Dim value As ExtendedProperties

value = instance.ExtendedProperties
public ExtendedProperties ExtendedProperties { get; }
public:
property ExtendedProperties^ ExtendedProperties {
    ExtendedProperties^ get ();
}
/** @property */
public ExtendedProperties get_ExtendedProperties()
public function get ExtendedProperties () : ExtendedProperties

属性值

类型:Microsoft.Ink.ExtendedProperties
应用程序定义的数据的集合。

备注

应用程序可以使用 ExtendedProperties 属性访问 Ink 对象中存储的自定义数据。此自定义数据自动随对象序列化。

示例

在此示例中,将检查 Dirty 属性。如果为 true,则 InkOverlay 对象的 Ink 对象以默认 InkSerializedFormat (ISF) 保存到文件。将 ExtendedProperty 添加到 Ink 对象以跟踪墨迹的保存时间。

Try
    If mInkOverlay.Ink.Dirty Then
        ' TIME_GUID is a class level string set via GUID generator
        Dim timeGuid As Guid = New Guid(TIME_GUID)
        mInkOverlay.Ink.ExtendedProperties.Add(timeGuid, DateTime.Now)
        ' FILE_NAME is a class level const
        Using FS As FileStream = New FileStream(FILE_NAME, FileMode.Create)
            Dim isf As Byte() = mInkOverlay.Ink.Save()
            FS.Write(isf, 0, isf.Length)
        End Using
    End If
Catch
    ' handle or rethrow
End Try
try
{
    if (mInkOverlay.Ink.Dirty)
    {
        // TIME_GUID is a class level string set via GUID generator
        Guid timeGuid = new Guid(TIME_GUID);
        mInkOverlay.Ink.ExtendedProperties.Add(timeGuid, DateTime.Now);
        // FILE_NAME is a class level const
        using (FileStream FS = new FileStream(FILE_NAME, FileMode.Create))
        {
            byte[] isf = mInkOverlay.Ink.Save();
            FS.Write(isf, 0, isf.Length);
        }
    }
}
catch 
{
    // handle or rethrow
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

Ink 类

Ink 成员

Microsoft.Ink 命名空间

ExtendedProperties

ExtendedProperty