ObjectNode Class
Represents a ContextNode for a node that is returned from an object custom recognizer.
Assembly: IAWinFX (in IAWinFX.dll)
For more information about how object recognizers work, see Object Recognizers.
An ObjectNode cannot contain any child elements.
ObjectNode objects are only contained by a CustomRecognizerNode object.
The following example loops through the child nodes of a CustomRecognizerNode object, musicRecognizer. It then finds each ObjectNode and retrieves the relevant properties. The application treats each ObjectNode as a musical note. The custom recognizer adds five properties (letter, octave, measure, withinMeasure, and duration) to describe the note. The GetPropertyData method retrieves the data with the following Guid members: noteLetterId, noteOctaveId, noteMeasureId, noteWithinMeasureId, and noteDurationId. After all the data is collected, the DrawNote method draws the note.
Dim subNode As ContextNode For Each subNode In musicRecognizer.SubNodes If TypeOf subNode Is ObjectNode Then ' Assume all object nodes represent notes Dim noteObject As ObjectNode = CType(subNode, ObjectNode) Dim letter As String If noteObject.ContainsPropertyData(Me.noteLetterId) Then letter = CStr(noteObject.GetPropertyData(Me.noteLetterId)) Else letter = "" End If Dim octave As Integer If noteObject.ContainsPropertyData(Me.noteOctaveId) Then octave = Fix(noteObject.GetPropertyData(Me.noteOctaveId)) Else octave = - 1 End If Dim measure As Integer If noteObject.ContainsPropertyData(Me.noteMeasureId) Then measure = Fix(noteObject.GetPropertyData(Me.noteMeasureId)) Else measure = - 1 End If Dim withinMeasure As Integer If noteObject.ContainsPropertyData(Me.noteWithinMeasureId) Then withinMeasure = Fix(noteObject.GetPropertyData(Me.noteWithinMeasureId)) Else withinMeasure = - 1 End If Dim duration As Integer If noteObject.ContainsPropertyData(Me.noteOctaveId) Then duration = Fix(noteObject.GetPropertyData(Me.noteDurationId)) Else duration = - 1 End If ' Draw note if all data is valid If letter.Length > 0 AndAlso octave >= 0 AndAlso _ measure >= 0 AndAlso withinMeasure >= 0 AndAlso duration >= 0 Then DrawNote(letter, octave, measure, withinMeasure, duration) End If End If Next subNode
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.