Quickstarts.DataAccessServer.UnderlyingSystemBlock.GetTags C# (CSharp) Méthode

GetTags() public méthode

Returns a snapshot of the tags belonging to the block.
public GetTags ( ) : IList
Résultat IList
        public IList<UnderlyingSystemTag> GetTags()
        {
            lock (m_tags)
            {
                // create snapshots of the tags.
                UnderlyingSystemTag[] tags = new UnderlyingSystemTag[m_tags.Count];

                for (int ii = 0; ii < m_tags.Count; ii++)
                {
                    tags[ii] = m_tags[ii].CreateSnapshot();
                }

                return tags;
            }
        }
                    

Usage Example

        /// <summary>
        /// Initializes a new instance of the <see cref="BlockState"/> class.
        /// </summary>
        /// <param name="nodeManager">The context.</param>
        /// <param name="nodeId">The node id.</param>
        /// <param name="block">The block.</param>
        public BlockState(
            DataAccessServerNodeManager nodeManager,
            NodeId nodeId,
            UnderlyingSystemBlock block) : base(null)
        {
            m_blockId     = block.Id;
            m_nodeManager = nodeManager;

            this.SymbolicName  = block.Name;
            this.NodeId        = nodeId;
            this.BrowseName    = new QualifiedName(block.Name, nodeId.NamespaceIndex);
            this.DisplayName   = new LocalizedText(block.Name);
            this.Description   = null;
            this.WriteMask     = 0;
            this.UserWriteMask = 0;
            this.EventNotifier = EventNotifiers.None;

            UnderlyingSystem system = nodeManager.SystemContext.SystemHandle as UnderlyingSystem;

            if (system != null)
            {
                IList <UnderlyingSystemTag> tags = block.GetTags();

                for (int ii = 0; ii < tags.Count; ii++)
                {
                    BaseVariableState variable = CreateVariable(nodeManager.SystemContext, tags[ii]);
                    AddChild(variable);
                    variable.OnSimpleWriteValue = OnWriteTagValue;
                }
            }
        }
All Usage Examples Of Quickstarts.DataAccessServer.UnderlyingSystemBlock::GetTags