Opc.Ua.ViewTable.Remove C# (CSharp) Method

Remove() public method

Removes a view from the table.
public Remove ( Opc.Ua.NodeId viewId ) : void
viewId Opc.Ua.NodeId The view identifier.
return void
        public void Remove(NodeId viewId)
        {
            if (NodeId.IsNull(viewId)) throw new ArgumentNullException("viewId");
                        
            lock (m_lock)
            {
                // find view.
                ViewNode view = null;

                if (!m_views.TryGetValue(viewId, out view))
                {
                    throw new ServiceResultException(
                        StatusCodes.BadViewIdUnknown,
                        Utils.Format("A reference type with the node id '{0}' does not exist.", viewId));
                }

                // remove view node.
                m_views.Remove(viewId);
            }
        }
        #endregion