InkAnalyzerBase.ModifyTopAlternate Method (AnalysisAlternateBase)
Changes the current top alternate to the specified AnalysisAlternateBase and clears the confirmation type for all context nodes associated with the alternate.
Namespace: System.Windows.Ink.AnalysisCore
Assembly: IACore (in IACore.dll)
Syntax
'Declaration
Public Function ModifyTopAlternate ( _
alternate As AnalysisAlternateBase _
) As Boolean
'Usage
Dim instance As InkAnalyzerBase
Dim alternate As AnalysisAlternateBase
Dim returnValue As Boolean
returnValue = instance.ModifyTopAlternate(alternate)
public bool ModifyTopAlternate(
AnalysisAlternateBase alternate
)
public:
bool ModifyTopAlternate(
AnalysisAlternateBase^ alternate
)
public function ModifyTopAlternate(
alternate : AnalysisAlternateBase
) : boolean
Parameters
alternate
Type: System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseThe alternate to set as the top alternate.
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 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
System.Windows.Ink.AnalysisCore Namespace
System.Windows.Ink.AnalysisCore.AnalysisAlternateBase