Opc.Ua.Com.ComServerStatusState.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.Com.BrowseNames.ServerUrl:
                {
                    if (createOrReplace)
                    {
                        if (ServerUrl == null)
                        {
                            if (replacement == null)
                            {
                                ServerUrl = new PropertyState<string>(this);
                            }
                            else
                            {
                                ServerUrl = (PropertyState<string>)replacement;
                            }
                        }
                    }

                    instance = ServerUrl;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.VendorInfo:
                {
                    if (createOrReplace)
                    {
                        if (VendorInfo == null)
                        {
                            if (replacement == null)
                            {
                                VendorInfo = new PropertyState<string>(this);
                            }
                            else
                            {
                                VendorInfo = (PropertyState<string>)replacement;
                            }
                        }
                    }

                    instance = VendorInfo;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.SoftwareVersion:
                {
                    if (createOrReplace)
                    {
                        if (SoftwareVersion == null)
                        {
                            if (replacement == null)
                            {
                                SoftwareVersion = new PropertyState<string>(this);
                            }
                            else
                            {
                                SoftwareVersion = (PropertyState<string>)replacement;
                            }
                        }
                    }

                    instance = SoftwareVersion;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.ServerState:
                {
                    if (createOrReplace)
                    {
                        if (ServerState == null)
                        {
                            if (replacement == null)
                            {
                                ServerState = new PropertyState<string>(this);
                            }
                            else
                            {
                                ServerState = (PropertyState<string>)replacement;
                            }
                        }
                    }

                    instance = ServerState;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.CurrentTime:
                {
                    if (createOrReplace)
                    {
                        if (CurrentTime == null)
                        {
                            if (replacement == null)
                            {
                                CurrentTime = new PropertyState<DateTime>(this);
                            }
                            else
                            {
                                CurrentTime = (PropertyState<DateTime>)replacement;
                            }
                        }
                    }

                    instance = CurrentTime;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.StartTime:
                {
                    if (createOrReplace)
                    {
                        if (StartTime == null)
                        {
                            if (replacement == null)
                            {
                                StartTime = new PropertyState<DateTime>(this);
                            }
                            else
                            {
                                StartTime = (PropertyState<DateTime>)replacement;
                            }
                        }
                    }

                    instance = StartTime;
                    break;
                }

                case Opc.Ua.Com.BrowseNames.LastUpdateTime:
                {
                    if (createOrReplace)
                    {
                        if (LastUpdateTime == null)
                        {
                            if (replacement == null)
                            {
                                LastUpdateTime = new PropertyState<DateTime>(this);
                            }
                            else
                            {
                                LastUpdateTime = (PropertyState<DateTime>)replacement;
                            }
                        }
                    }

                    instance = LastUpdateTime;
                    break;
                }
            }

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

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