ContextNodeBaseCollection.Add 方法

ContextNodeBaseCollection 中添加 ContextNodeBase 对象。

命名空间:  System.Windows.Ink.AnalysisCore
程序集:  IACore(在 IACore.dll 中)

语法

声明
Public Function Add ( _
    nodeToAdd As ContextNodeBase _
) As Integer
用法
Dim instance As ContextNodeBaseCollection
Dim nodeToAdd As ContextNodeBase
Dim returnValue As Integer

returnValue = instance.Add(nodeToAdd)
public int Add(
    ContextNodeBase nodeToAdd
)
public:
int Add(
    ContextNodeBase^ nodeToAdd
)
public int Add(
    ContextNodeBase nodeToAdd
)
public function Add(
    nodeToAdd : ContextNodeBase
) : int

参数

返回值

类型:System.Int32
添加 ContextNodeBase 的位置的索引。如果 nodeToAdd 已存在于集合中,则 Add 方法返回该节点在集合中的位置的索引。如果 Add 无法添加 ContextNodeBase,则返回 -1。

示例

下面的示例从 InkAnalyzerBase (theInkAnalyzerBase) 创建一个类型为 Paragraph 的新 ContextNodeBase,并将其添加到名为 nodes 的 ContextNodeBaseCollection 中。

Dim paragraph As ContextNodeBase = _
    theInkAnalyzerBase.RootNode.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph)
nodes.Add(paragraph)
            ContextNodeBase paragraph = theInkAnalyzer.RootNode.CreateSubNode(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Paragraph);
            nodes.Add(paragraph);

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ContextNodeBaseCollection 类

ContextNodeBaseCollection 成员

System.Windows.Ink.AnalysisCore 命名空间