Opc.Ua.Di.FunctionalGroupState.FindChild C# (CSharp) Method

FindChild() protected method

Finds the child with the specified browse name.
protected FindChild ( ISystemContext context, Opc.Ua.QualifiedName browseName, bool createOrReplace, BaseInstanceState replacement ) : BaseInstanceState
context ISystemContext
browseName Opc.Ua.QualifiedName
createOrReplace bool
replacement Opc.Ua.BaseInstanceState
return Opc.Ua.BaseInstanceState
        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.Di.BrowseNames.UIElement:
                {
                    if (createOrReplace)
                    {
                        if (UIElement == null)
                        {
                            if (replacement == null)
                            {
                                UIElement = new UIElementState(this);
                            }
                            else
                            {
                                UIElement = (UIElementState)replacement;
                            }
                        }
                    }

                    instance = UIElement;
                    break;
                }
            }

            if (instance != null)
            {
                return instance;
            }

            return base.FindChild(context, browseName, createOrReplace, replacement);
        }