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
在设置与分析备选项对象对应的所有墨迹叶上下文节点时,如果要将 NodeTypeAndProperties 确认属性应用于这些节点,则为 true;如果要将 None 确认属性应用于这些节点,则为 false。
返回值
备注
若要获取分析备选项,请使用 GetAlternates。若要获取与分析备选项关联的上下文节点,请使用 AnalysisAlternateBase.AlternateNodes。
若要更改上下文节点的确认类型,请使用 ContextNodeBase.Confirm。
示例
下面的示例修改 ContextNodeBaseCollection (theLineNodes) 的最佳备选项。在此示例中,theLineNodes 包含从 InkAnalyzerBase (theInkAnalyzerBase) 选择的行节点。布尔值 confirmationEnabled 指示应用程序是否已启用节点确认。如果应用程序已启用节点确认,则布尔值 confirmAutomatically 指示是清除还是保持现有确认类型。
此示例使用帮助器方法 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