共用方式為


ContextNodeBaseCollection.Add 方法

ContextNodeBase 物件加入至 ContextNodeBaseCollection

命名空間:  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,並且將它加入至 ContextNodeBaseCollection (名為 nodes)。

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 命名空間