SuspendableDocumentNodeChildCopyToMemberOrCreateNewT Method |
Copies a document node from another source into a member of this instance.
If an old instance member (provided in myChild exists and can not be used, it is disposed first.
If the node is not null, the node is then copied using either Main.ICopyFrom or System.ICloneable. If the node is null, a new node is created using the provided generation function.
The resulting node's ParentObject is then set to this instance in order to maintain the parent-child relationship.
Namespace: Altaxo.MainAssembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax protected bool ChildCopyToMemberOrCreateNew<T>(
ref T? myChild,
T fromAnotherChild,
Func<T> createNew
)
where T : class, IDocumentLeafNode, ICloneable
Parameters
- myChild T
- Reference to a member variable of this instance that holds a child node.
- fromAnotherChild T
- Another child node to copy from. If null, the child node of this instance is also set to null.
- createNew FuncT
- If the parameter fromAnotherChild is null, the provided function is used to create a new object of type T. This object is then used to set the member.
Type Parameters
- T
- Type of the node to copy.
Return Value
Boolean[Missing <returns> documentation for "M:Altaxo.Main.SuspendableDocumentNode.ChildCopyToMemberOrCreateNew``1(``0@,``0,System.Func{``0})"]
See Also