Пример #1
0
        //TODO: IfcProperty filterining on IfcObjects

        /// <summary>
        /// Test property Names against sheets
        /// </summary>
        /// <param name="testStr">Name string to test</param>
        /// <param name="parent">Parent object</param>
        /// <returns>bool</returns>
        public bool NameFilterOnParent(string testStr, CobieObject parent = null)
        {
            var result = false;

            if (!string.IsNullOrEmpty(testStr))
            {
                result = CommonFilter.NameFilter(testStr);
                if (!result)
                {
                    if (parent == null)
                    {
                        result = false;
                    }
                    else if ((parent is Zone) && (ZoneFilter != null))
                    {
                        result = ZoneFilter.NameFilter(testStr);
                    }
                    else if ((parent is AssetType) && (TypeFilter != null))
                    {
                        result = TypeFilter.NameFilter(testStr);
                    }
                    else if ((parent is Space) && (SpaceFilter != null))
                    {
                        result = SpaceFilter.NameFilter(testStr);
                    }
                    else if ((parent is Floor) && (FloorFilter != null))
                    {
                        result = FloorFilter.NameFilter(testStr);
                    }
                    else if ((parent is Facility) && (FacilityFilter != null))
                    {
                        result = FacilityFilter.NameFilter(testStr);
                    }
                    else if ((parent is Spare) && (SpareFilter != null))
                    {
                        result = SpareFilter.NameFilter(testStr);
                    }
                    else if ((parent is Asset) && (ComponentFilter != null))
                    {
                        result = ComponentFilter.NameFilter(testStr);
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            return(FlipResult ? !result : result);
        }