Beispiel #1
0
        /// <summary>
        /// determine whether the object should be included in the output
        /// </summary>
        /// <param name="obj">the object in question</param>
        /// <param name="filterReason">any explanation of why the object should not be included</param>
        /// <returns>true if the object should be included in the output</returns>
        public bool DoInclude(CmObject obj, out string filterReason)
        {
            ConstraintFailure failure;

            //discussion: should we were first check can to see if there are already errors?
            //  pro: it would be faster on the relatively few objects that already have error annotations
            //	con: it would allow a error which is no longer true to live on, causing problems
            //	decision: just go ahead in check them every time.
            if (!obj.CheckConstraints(0, out failure))
            {
                filterReason = failure.GetMessage();
                return(false);
            }
            filterReason = null;
            return(true);
        }