Поделиться через


Ink.Dirty - свойство

Обновлен: Ноябрь 2007

Gets or sets the value that indicates whether an Ink object has been modified since the last time the ink was saved.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Property Dirty As Boolean
'Применение
Dim instance As Ink
Dim value As Boolean

value = instance.Dirty

instance.Dirty = value
public bool Dirty { get; set; }
public:
property bool Dirty {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_Dirty()
/** @property */
public  void set_Dirty(boolean value)
public function get Dirty () : boolean
public function set Dirty (value : boolean)

Значение свойства

Тип: System.Boolean
true if the Ink has been modified since the last time the Ink was saved; otherwise, false.

Заметки

After ink is saved, the Dirty property is automatically cleared and the value of this property is set to false. To save an Ink object, call the Save method.

Примеры

In this example, the Dirty property is examined. If true, the Ink object of an InkOverlay object is saved to a file in the default InkSerializedFormat (ISF). An ExtendedProperty is added to the Ink object to track the time that the ink was saved.

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 - пространство имен

Ink.Save