CursorButton.Id - свойство
Обновлен: Ноябрь 2007
Gets the identifier of the CursorButton object.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public ReadOnly Property Id As Guid
'Применение
Dim instance As CursorButton
Dim value As Guid
value = instance.Id
public Guid Id { get; }
public:
property Guid Id {
Guid get ();
}
/** @property */
public Guid get_Id()
public function get Id () : Guid
Значение свойства
Тип: System.Guid
The CursorButton object's identifier.
Заметки
Примечание. |
---|
A CursorButton object's identifier is constant over time, meaning that it never changes. |
Примеры
This C# example returns a report on the attributes of all of the cursors that are encountered by the InkCollector object passed in as a parameter. It includes CursorButton information, such as the Id property.
using Microsoft.Ink;
//. . .
public string CursorReport(InkCollector theInkCollector)
{
string theReport = "The InkCollector has encountered the following cursors so far:" + Environment.NewLine;
// Get the Cursors collection from the InkCollector
Microsoft.Ink.Cursors theCursors = theInkCollector.Cursors;
// Prevent changes to the collection while we iterate over it.
lock( theCursors.SyncRoot )
{
theReport += "Count of cursors: " + theCursors.Count + Environment.NewLine + Environment.NewLine ;
foreach (Microsoft.Ink.Cursor cursor in theCursors)
{
theReport += "Cursor Name: " + cursor.Name + Environment.NewLine;
theReport += "Cursor ToString: " + cursor.ToString() + Environment.NewLine;
theReport += "Tablet Name: " + cursor.Tablet.Name + Environment.NewLine;
theReport += "Cursor Id: " + cursor.Id.ToString() + Environment.NewLine;
theReport += "Cursor is inverted: " + cursor.Inverted.ToString() + Environment.NewLine;
theReport += "Cursor Buttons:" + Environment.NewLine;
foreach (CursorButton button in cursor.Buttons)
{
CursorButtonState theState = button.State;
theReport += " Button Name: " + button.Name + Environment.NewLine;
theReport += " State: " + button.State.ToString() + Environment.NewLine;
theReport += " Id: " + button.Id.ToString() + Environment.NewLine + Environment.NewLine;
}
}
}
return theReport;
}
This Microsoft® Visual Basic® .NET example returns a report on the attributes of all of the cursors that are encountered by the InkCollector object passed in as a parameter. It includes CursorButton information, such as the Id property.
Imports Microsoft.Ink
'. . .
Public Function CursorReport(ByVal theInkCollector As InkCollector) _
As String
Dim theReport As String = "The InkCollector has encountered " & _
"the following cursors so far:" & vbCrLf
' Get the Cursors collection from the InkCollector
Dim theCursors As Cursors = theInkCollector.Cursors
' Prevent changes to the collection while we iterate over it.
SyncLock theCursors.SyncRoot
theReport &= "Count of cursors: " & theCursors.Count & vbCrLf
Dim theCursor As Cursor
For Each theCursor In theCursors
theReport &= "Cursor Name: " & theCursor.Name & vbCrLf
theReport &= "Cursor ToString: " & theCursor.ToString() & _
vbCrLf
theReport &= "Tablet Name: " & theCursor.Tablet.Name & vbCrLf
theReport &= "Cursor Id: " & theCursor.Id.ToString() & vbCrLf
theReport &= "Cursor is inverted: " & _
theCursor.Inverted.ToString() & vbCrLf
theReport &= "Cursor Buttons:" & vbCrLf
Dim theButton As CursorButton
For Each theButton In theCursor.Buttons
Dim theState As CursorButtonState = theButton.State
theReport &= " Button Name: " & theButton.Name & vbCrLf
theReport &= " State: " & _
theButton.State.ToString() & vbCrLf
theReport &= " Id: " & theButton.Id.ToString() & _
vbCrLf & vbCrLf
Next
Next
End SyncLock
Return theReport
End Function
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0