InkAnalyzerBase.ModifyTopAlternate 方法 (AnalysisAlternateBase, Boolean)
將目前的頂端替代項目變更為指定的 AnalysisAlternateBase。
命名空間: System.Windows.Ink.AnalysisCore
組件: IACore (在 IACore.dll 中)
語法
'宣告
Public Function ModifyTopAlternate ( _
alternate As AnalysisAlternateBase, _
confirmAutomatically As Boolean _
) As Boolean
'用途
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 boolean ModifyTopAlternate(
AnalysisAlternateBase alternate,
boolean confirmAutomatically
)
public function ModifyTopAlternate(
alternate : AnalysisAlternateBase,
confirmAutomatically : boolean
) : boolean
參數
- alternate
型別:System.Windows.Ink.AnalysisCore.AnalysisAlternateBase
要設定為頂端替代項目的替代項目。
- confirmAutomatically
型別:System.Boolean
若為 true,則會設定對應至分析替代項目物件的所有筆墨分葉內容節點,以便對這些節點套用 NodeTypeAndProperties 的已確認屬性。若為 false,則會設定對應至分析替代項目物件的所有筆墨分葉內容節點,以便對這些節點套用 None 的已確認屬性。
傳回值
備註
若要取得分析替代項目,請使用 GetAlternates。若要取得與分析替代項目相關的內容節點,請使用 AnalysisAlternateBase.AlternateNodes。
若要變更內容節點的確認類型,請使用 ContextNodeBase.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
請參閱
參考
System.Windows.Ink.AnalysisCore 命名空間
System.Windows.Ink.AnalysisCore.AnalysisAlternateBase