Esempio n. 1
0
        /// <summary>
        /// Adds an inspection context to this element.
        /// </summary>
        /// <param name="inspectionContext">The inspection context to add.</param>
        /// <exception cref="NullReferenceException">The inspection context is <see langword="null"/>.</exception>
        public void AddContext(InspectionContext inspectionContext)
        {
            if (null == inspectionContext)
            {
                throw new NullReferenceException(nameof(inspectionContext));
            }

            m_InspectionContexts.Add(inspectionContext);
            ForceReload();
        }
Esempio n. 2
0
        /// <summary>
        /// Removes an inspection context from this element.
        /// </summary>
        /// <param name="inspectionContext">The inspection context to add.</param>
        /// <exception cref="NullReferenceException">The inspection context is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException">The inspection context was not previously added.</exception>
        public void RemoveContext(InspectionContext inspectionContext)
        {
            if (null == inspectionContext)
            {
                throw new NullReferenceException(nameof(inspectionContext));
            }

            if (!m_InspectionContexts.Remove(inspectionContext))
            {
                throw new ArgumentException(nameof(inspectionContext));
            }

            ForceReload();
        }