共用方式為


InkAnalyzerBase.ModifyTopAlternate 方法 (AnalysisAlternateBase)

將目前的頂端替代項目變更為指定的 AnalysisAlternateBase,並且清除與這個替代項目相關聯的所有內容節點的確認類型。

命名空間:  System.Windows.Ink.AnalysisCore
組件:  IACore (在 IACore.dll 中)

語法

'宣告
Public Function ModifyTopAlternate ( _
    alternate As AnalysisAlternateBase _
) As Boolean
'用途
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 boolean ModifyTopAlternate(
    AnalysisAlternateBase alternate
)
public function ModifyTopAlternate(
    alternate : AnalysisAlternateBase
) : boolean

參數

傳回值

型別:System.Boolean

備註

若要取得分析替代項目,請使用 GetAlternates。若要取得與分析替代項目相關的內容節點,請使用 AnalysisAlternateBase.AlternateNodes

若要變更內容節點的確認類型,請使用 Confirm

範例

下列範例會修改 ContextNodeBaseCollection (theLineNodes) 的頂端替代項目。在這個範例中,theLineNodes 包含從 InkAnalyzerBase (theInkAnalyzerBase) 選取的行節點。布林值 confirmationEnabled 指出用程式是否已啟用節點確認。如果應用程式已啟用節點確認,則布林值 confirmAutomatically 指出現有確認類型已清除或保留。

這個範例會使用 Helper 方法 SelectAnalysisAlternate 選取要設為頂端替代項目的分析替代項目。

' 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);
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

InkAnalyzerBase 類別

InkAnalyzerBase 成員

ModifyTopAlternate 多載

System.Windows.Ink.AnalysisCore 命名空間

System.Windows.Ink.AnalysisCore.AnalysisAlternateBase

System.Windows.Ink.AnalysisCore.ContextNodeBase

System.Windows.Ink.AnalysisCore.ConfirmationType