IsDefault() public static method

Returns true if the view description represents the default (null) view.
public static IsDefault ( ViewDescription view ) : bool
view ViewDescription
return bool
Exemplo n.º 1
0
        /// <summary>
        /// Determines whether a node id is a valid view id.
        /// </summary>
        /// <param name="description">The description.</param>
        /// <returns>
        ///     <c>true</c> if the specified description is valid; otherwise, <c>false</c>.
        /// </returns>
        public bool IsValid(ViewDescription description)
        {
            if (ViewDescription.IsDefault(description))
            {
                return(true);
            }

            lock (m_lock) {
                return(m_views.ContainsKey(description.ViewId));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether a reference is in a view.
        /// </summary>
        /// <param name="description">The description.</param>
        /// <param name="reference">The reference.</param>
        /// <returns>
        ///     <c>true</c> whether a reference is in a view; otherwise, <c>false</c>.
        /// </returns>
        public bool IsReferenceInView(ViewDescription description, ReferenceDescription reference)
        {
            // everything is in the default view.
            if (ViewDescription.IsDefault(description))
            {
                return(true);
            }

            lock (m_lock) {
                ViewNode view = null;

                if (m_views.TryGetValue(description.ViewId, out view))
                {
                    throw new ServiceResultException(StatusCodes.BadViewIdUnknown);
                }

                return(false);
            }
        }