protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case Opc.Ua.Plc.BrowseNames.Tasks:
{
if (createOrReplace)
{
if (Tasks == null)
{
if (replacement == null)
{
Tasks = new ConfigurableObjectState(this);
}
else
{
Tasks = (ConfigurableObjectState)replacement;
}
}
}
instance = Tasks;
break;
}
case Opc.Ua.Plc.BrowseNames.Programs:
{
if (createOrReplace)
{
if (Programs == null)
{
if (replacement == null)
{
Programs = new ConfigurableObjectState(this);
}
else
{
Programs = (ConfigurableObjectState)replacement;
}
}
}
instance = Programs;
break;
}
case Opc.Ua.Plc.BrowseNames.GlobalVars:
{
if (createOrReplace)
{
if (GlobalVars == null)
{
if (replacement == null)
{
GlobalVars = new FunctionalGroupState(this);
}
else
{
GlobalVars = (FunctionalGroupState)replacement;
}
}
}
instance = GlobalVars;
break;
}
case Opc.Ua.Plc.BrowseNames.Configuration:
{
if (createOrReplace)
{
if (Configuration == null)
{
if (replacement == null)
{
Configuration = new FunctionalGroupState(this);
}
else
{
Configuration = (FunctionalGroupState)replacement;
}
}
}
instance = Configuration;
break;
}
case Opc.Ua.Plc.BrowseNames.Diagnostic:
{
if (createOrReplace)
{
if (Diagnostic == null)
{
if (replacement == null)
{
Diagnostic = new FunctionalGroupState(this);
}
else
{
Diagnostic = (FunctionalGroupState)replacement;
}
}
}
instance = Diagnostic;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}