Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SegmentState"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="nodeId">The node id.</param>
        /// <param name="segment">The segment.</param>
        public SegmentState(ISystemContext context, NodeId nodeId, UnderlyingSystemSegment segment) : base(null)
        {
            m_segmentPath = segment.Id;

            this.TypeDefinitionId = ObjectTypeIds.FolderType;
            this.SymbolicName     = segment.Name;
            this.NodeId           = nodeId;
            this.BrowseName       = new QualifiedName(segment.Name, nodeId.NamespaceIndex);
            this.DisplayName      = new LocalizedText(segment.Name);
            this.Description      = null;
            this.WriteMask        = 0;
            this.UserWriteMask    = 0;
            this.EventNotifier    = EventNotifiers.None;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SegmentState"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="nodeId">The node id.</param>
        /// <param name="segment">The segment.</param>
        public SegmentState(ISystemContext context, NodeId nodeId, UnderlyingSystemSegment segment) : base(null)
        {
            m_segmentPath = segment.Id;

            this.TypeDefinitionId = ObjectTypeIds.FolderType;
            this.SymbolicName = segment.Name;
            this.NodeId = nodeId;
            this.BrowseName = new QualifiedName(segment.Name, nodeId.NamespaceIndex);
            this.DisplayName = new LocalizedText(segment.Name);
            this.Description = null;
            this.WriteMask = 0;
            this.UserWriteMask = 0;
            this.EventNotifier = EventNotifiers.None;
        }
Пример #3
0
        /// <summary>
        /// Populates the browser with references that meet the criteria.
        /// </summary>
        /// <param name="context">The context for the system being accessed.</param>
        /// <param name="browser">The browser to populate.</param>
        protected override void PopulateBrowser(ISystemContext context, NodeBrowser browser)
        {
            base.PopulateBrowser(context, browser);

            // check if the parent segments need to be returned.
            if (browser.IsRequired(ReferenceTypeIds.Organizes, true))
            {
                UnderlyingSystem system = context.SystemHandle as UnderlyingSystem;

                if (system == null)
                {
                    return;
                }

                // add reference for parent segment.
                UnderlyingSystemSegment segment = system.FindParentForSegment(m_segmentPath);

                if (segment != null)
                {
                    browser.Add(ReferenceTypeIds.Organizes, true, ModelUtils.ConstructIdForSegment(segment.Id, this.NodeId.NamespaceIndex));
                }
            }
        }