protected BaseInstanceSource InitializeOptionalChild(
ConstructInstanceDelegate constructInstanceDelegate,
NodeId referenceTypeId,
QualifiedName browseName,
uint numericId,
object configuration)
{
CheckNodeManagerState();
// check if nothing to do.
if (constructInstanceDelegate == null)
{
return null;
}
// check if node exists.
ILocalNode existingChild = NodeManager.GetTargetNode(
this.NodeId,
referenceTypeId,
false,
true,
browseName) as ILocalNode;
if (existingChild == null)
{
return null;
}
BaseInstanceSource child = constructInstanceDelegate(
Server,
this,
referenceTypeId,
null,
browseName,
numericId);
// create it.
child.Create(this.NodeId, child.ReferenceTypeId, null, null, numericId, configuration);
return child;
}