Ink.InkSerializedFormat - поле
Обновлен: Ноябрь 2007
Returns a string that contains the name of the format for ink serialized format (ISF) for querying the Clipboard.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Shared ReadOnly InkSerializedFormat As String
'Применение
Dim value As String
value = Ink.InkSerializedFormat
public static readonly string InkSerializedFormat
public:
static initonly String^ InkSerializedFormat
public static final String InkSerializedFormat
public static final var InkSerializedFormat : String
Значение поля
Тип: System.String
The name of the format for ink serialized format (ISF).
Заметки
This name should be used to query DataObject on the Clipboard to see if it contains that particular format.
Примеры
This C# example shows how you could have a menu item called menuItemEdit which contains two submenus called menuItemCopy and menuItemPaste for copying and pasting selected strokes. Two methods are shown: menuItemCopy_Click (the event handler that is called when menuItemCopy is clicked) and menuItemEdit_Popup (the event handler that is called when the submenus of menuItemEdit are shown). In menuItemCopy, the selected ink from an InkOverlay named theInkOverlay is copied into the clipboard in Ink Serialized Format. In menuItemEdit_Popup, the menuItemCopy control is only enabled if one or more strokes are selected, and the menuItemPaste control is only enabled if ink has been copied to the clipboard in ISF. You can check this by using the InkSerializedFormat field.
private void menuItemCopy_Click(object sender, System.EventArgs e)
{
// Check if anything is selected
if (theInkOverlay.Selection.Count > 0)
{
// Copy the ink as ISF
theInkOverlay.Ink.ClipboardCopy(theInkOverlay.Selection,
InkClipboardFormats.InkSerializedFormat, InkClipboardModes.Copy);
}
}
private void menuItemEdit_Popup(object sender, System.EventArgs e)
{
// Only enable Copy if something is selected
menuItemCopy.Enabled = (theInkOverlay.Selection.Count > 0);
// Only enable Paste if ink serialialized format is in the clipboard
IDataObject clipboardObject = Clipboard.GetDataObject();
menuItemPaste.Enabled =
clipboardObject.GetDataPresent(Ink.InkSerializedFormat);
}
This Microsoft Visual Basic.NET example shows how you could have a menu item called menuItemEdit which contains two submenus called menuItemCopy and menuItemPaste for copying and pasting selected strokes. Two methods are shown: menuItemCopy_Click (the event handler that is called when menuItemCopy is clicked) and menuItemEdit_Popup (the event handler that is called when the submenus of menuItemEdit are shown). In menuItemCopy, the selected ink from an InkOverlay named theInkOverlay is copied into the clipboard in Ink Serialized Format. In menuItemEdit_Popup, the menuItemCopy control is only enabled if one or more strokes are selected, and the menuItemPaste control is only enabled if ink has been copied to the clipboard in ISF. You can check this by using the InkSerializedFormat field.
Private Sub MenuItemCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemCopy.Click
' Check if anything is selected
If theInkOverlay.Selection.Count > 0 Then
' Copy the ink as ISF
theInkOverlay.Ink.ClipboardCopy(theInkOverlay.Selection, _
InkClipboardFormats.InkSerializedFormat, InkClipboardModes.Copy)
End If
End Sub
Private Sub MenuItemEdit_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItemEdit.Popup
' Only enable Copy if something is selected
If theInkOverlay.Selection.Count > 0 Then
MenuItemCopy.Enabled = True
Else
MenuItemCopy.Enabled = False
End If
' Only enable Paste if ink serialialized format is in the clipboard
Dim clipboardObject As IDataObject = Clipboard.GetDataObject()
If clipboardObject.GetDataPresent(Ink.InkSerializedFormat) = True Then
MenuItemPaste.Enabled = True
Else
MenuItemPaste.Enabled = False
End If
End Sub
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0
См. также
Ссылки
Microsoft.Ink - пространство имен