/// <summary> /// Adds a view to the table. /// </summary> /// <param name="view">The view.</param> public void Add(ViewNode view) { if (view == null) throw new ArgumentNullException("view"); if (NodeId.IsNull(view.NodeId)) { throw new ServiceResultException( StatusCodes.BadNodeIdInvalid, Utils.Format("A view may not have a null node id.")); } lock (m_lock) { // check for duplicate id. if (m_views.ContainsKey(view.NodeId)) { throw new ServiceResultException( StatusCodes.BadNodeIdExists, Utils.Format("A view with the node id '{0}' already exists.", view.NodeId)); } // save view. m_views.Add(view.NodeId, view); } }