Ejemplo n.º 1
0
        /// <summary>
        /// Test Property Set Names against sheets
        /// </summary>
        /// <param name="testStr">Name string to test</param>
        /// <param name="parent">Parent object</param>
        /// <returns>bool</returns>
        public bool PSetNameFilterOnSheetName(string testStr, CobieObject parent = null)
        {
            bool result = false;

            if (!string.IsNullOrEmpty(testStr))
            {
                result = CommonFilter.PSetNameFilter(testStr);
                if (!result)
                {
                    if (parent == null)
                    {
                        result = false;
                    }
                    else if ((parent is Zone) && (ZoneFilter != null))
                    {
                        result = ZoneFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is AssetType) && (TypeFilter != null))
                    {
                        result = TypeFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is Space) && (SpaceFilter != null))
                    {
                        result = SpaceFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is Floor) && (FloorFilter != null))
                    {
                        result = FloorFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is Facility) && (FacilityFilter != null))
                    {
                        result = FacilityFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is Spare) && (SpareFilter != null))
                    {
                        result = SpareFilter.PSetNameFilter(testStr);
                    }
                    else if ((parent is Asset) && (ComponentFilter != null))
                    {
                        result = ComponentFilter.PSetNameFilter(testStr);
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            //don't flip property sets as this excludes all the attributes, so we do not see attribute name exclusions as all property sets get excluded
            //return FlipResult ? !result : result;
            return(result);
        }