Sdílet prostřednictvím


InkAnalyzerBase.ModifyTopAlternate Method (AnalysisAlternateBase, Boolean)

Changes the current top alternate to the specified AnalysisAlternateBase.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Function ModifyTopAlternate ( _
    alternate As AnalysisAlternateBase, _
    confirmAutomatically As Boolean _
) As Boolean
'Usage
Dim instance As InkAnalyzerBase 
Dim alternate As AnalysisAlternateBase 
Dim confirmAutomatically As Boolean 
Dim returnValue As Boolean 

returnValue = instance.ModifyTopAlternate(alternate, _
    confirmAutomatically)
public bool ModifyTopAlternate(
    AnalysisAlternateBase alternate,
    bool confirmAutomatically
)
public:
bool ModifyTopAlternate(
    AnalysisAlternateBase^ alternate, 
    bool confirmAutomatically
)
public function ModifyTopAlternate(
    alternate : AnalysisAlternateBase, 
    confirmAutomatically : boolean
) : boolean

Parameters

  • confirmAutomatically
    Type: System.Boolean

    true to set all of the ink leaf context nodes that correspond to the analysis alternate object to have a confirmed property of NodeTypeAndProperties applied to them; false to set all of the ink leaf context nodes that correspond to the analysis alternate object to have a confirmed property of None applied to them.

Return Value

Type: System.Boolean

Remarks

To get analysis alternates, use GetAlternates. To get the context nodes associated with an analysis alternate, use AnalysisAlternateBase.AlternateNodes.

To change the confirmation type for a context node, use ContextNodeBase.Confirm.

Examples

The following example modifies the top alternate for the ContextNodeBaseCollection, theLineNodes. In this example, theLineNodes contains selected line nodes from the InkAnalyzerBase, theInkAnalyzerBase. The Boolean value confirmationEnabled indicates whether the application has enabled node confirmation. If the application has enabled node confirmation, the Boolean value confirmAutomatically indicates whether the existing confirmation type is cleared or maintained.

The example uses a helper method, SelectAnalysisAlternate, to select the analysis alternate to set as the top alternate.

' Get alternates for the specified line nodes. 
Dim theAlternates As System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection = _
    theInkAnalyzerBase.GetAlternates(theLineNodes)

' Use a helper method to get the user's choice of alternate. 
Dim selectedAlternate As System.Windows.Ink.AnalysisCore.AnalysisAlternateBase = _
    Me.SelectAnalysisAlternate(theAlternates)

' Set the chosen alternate as the top alternate. 
If confirmationEnabled Then 
    ' If node confirmation is enabled, use the current setting 
    ' of confirmAutomatically to keep or clear the existing 
    ' confirmation status of the line nodes.
    theInkAnalyzerBase.ModifyTopAlternate( _
        selectedAlternate, confirmAutomatically)
Else 
    ' Otherwise, clear the confirmation as part of modifying 
    ' the top alternate.
    theInkAnalyzerBase.ModifyTopAlternate(selectedAlternate)
End If
// Get alternates for the specified line nodes.
System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection theAlternates =
    theInkAnalyzerBase.GetAlternates(theLineNodes);

// Use a helper method to get the user's choice of alternate.
System.Windows.Ink.AnalysisCore.AnalysisAlternateBase selectedAlternate =
    this.SelectAnalysisAlternate(theAlternates);

// Set the chosen alternate as the top alternate. 
if (confirmationEnabled)
{
    // If node confirmation is enabled, use the current setting 
    // of confirmAutomatically to keep or clear the existing 
    // confirmation status of the line nodes.
    theInkAnalyzerBase.ModifyTopAlternate(
        selectedAlternate, confirmAutomatically);
}
else
{
    // Otherwise, clear the confirmation as part of modifying 
    // the top alternate.
    theInkAnalyzerBase.ModifyTopAlternate(selectedAlternate);
}

Platforms

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.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzerBase Class

InkAnalyzerBase Members

ModifyTopAlternate Overload

System.Windows.Ink.AnalysisCore Namespace

System.Windows.Ink.AnalysisCore.AnalysisAlternateBase

System.Windows.Ink.AnalysisCore.ContextNodeBase

System.Windows.Ink.AnalysisCore.ConfirmationType