コード例 #1
0
        /// <summary>
        /// Finds the child with the specified browse name.
        /// </summary>
        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 ObjectTypeTest.BrowseNames.BrowseName4node66:
            {
                if (createOrReplace)
                {
                    if (BrowseName4node66 == null)
                    {
                        if (replacement == null)
                        {
                            BrowseName4node66 = new PropertyState <LocalizedText>(this);
                        }
                        else
                        {
                            BrowseName4node66 = (PropertyState <LocalizedText>)replacement;
                        }
                    }
                }

                instance = BrowseName4node66;
                break;
            }

            case ObjectTypeTest.BrowseNames.NameNotSet1109:
            {
                if (createOrReplace)
                {
                    if (NameNotSet1109 == null)
                    {
                        if (replacement == null)
                        {
                            NameNotSet1109 = new AnalogItemState(this);
                        }
                        else
                        {
                            NameNotSet1109 = (AnalogItemState)replacement;
                        }
                    }
                }

                instance = NameNotSet1109;
                break;
            }

            case ObjectTypeTest.BrowseNames.ChildMethod:
            {
                if (createOrReplace)
                {
                    if (ChildMethod == null)
                    {
                        if (replacement == null)
                        {
                            ChildMethod = new ChildMethodComplexObjectMethodState(this);
                        }
                        else
                        {
                            ChildMethod = (ChildMethodComplexObjectMethodState)replacement;
                        }
                    }
                }

                instance = ChildMethod;
                break;
            }

            case ObjectTypeTest.BrowseNames.NonExecutableMethod:
            {
                if (createOrReplace)
                {
                    if (NonExecutableMethod == null)
                    {
                        if (replacement == null)
                        {
                            NonExecutableMethod = new MethodState(this);
                        }
                        else
                        {
                            NonExecutableMethod = (MethodState)replacement;
                        }
                    }
                }

                instance = NonExecutableMethod;
                break;
            }
            }

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

            return(base.FindChild(context, browseName, createOrReplace, replacement));
        }
コード例 #2
0
        /// <summary>
        /// Finds the child with the specified browse name.
        /// </summary>
        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 ObjectTypeTest.BrowseNames.BrowseName4node66:
                {
                    if (createOrReplace)
                    {
                        if (BrowseName4node66 == null)
                        {
                            if (replacement == null)
                            {
                                BrowseName4node66 = new PropertyState<LocalizedText>(this);
                            }
                            else
                            {
                                BrowseName4node66 = (PropertyState<LocalizedText>)replacement;
                            }
                        }
                    }

                    instance = BrowseName4node66;
                    break;
                }

                case ObjectTypeTest.BrowseNames.NameNotSet1109:
                {
                    if (createOrReplace)
                    {
                        if (NameNotSet1109 == null)
                        {
                            if (replacement == null)
                            {
                                NameNotSet1109 = new AnalogItemState(this);
                            }
                            else
                            {
                                NameNotSet1109 = (AnalogItemState)replacement;
                            }
                        }
                    }

                    instance = NameNotSet1109;
                    break;
                }

                case ObjectTypeTest.BrowseNames.ChildMethod:
                {
                    if (createOrReplace)
                    {
                        if (ChildMethod == null)
                        {
                            if (replacement == null)
                            {
                                ChildMethod = new ChildMethodComplexObjectMethodState(this);
                            }
                            else
                            {
                                ChildMethod = (ChildMethodComplexObjectMethodState)replacement;
                            }
                        }
                    }

                    instance = ChildMethod;
                    break;
                }

                case ObjectTypeTest.BrowseNames.NonExecutableMethod:
                {
                    if (createOrReplace)
                    {
                        if (NonExecutableMethod == null)
                        {
                            if (replacement == null)
                            {
                                NonExecutableMethod = new MethodState(this);
                            }
                            else
                            {
                                NonExecutableMethod = (MethodState)replacement;
                            }
                        }
                    }

                    instance = NonExecutableMethod;
                    break;
                }
            }

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

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