public void FillLists(PropertyFilter psetFilter, bool readOnly = false)
        {
            //clear lists
            listViewEqTo.Items.Clear();
            listViewStartWith.Items.Clear();
            listViewContains.Items.Clear();
            listViewPSetEqTo.Items.Clear();

            //fill lists
            listViewEqTo.Items = psetFilter.EqualTo;
            listViewStartWith.Items = psetFilter.StartWith;
            listViewContains.Items = psetFilter.Contain;
            listViewPSetEqTo.Items = psetFilter.PropertySetsEqualTo;
            //set read only
            if (readOnly)
            {
                listViewEqTo.SetReadOnly();
                listViewStartWith.SetReadOnly();
                listViewContains.SetReadOnly();
                listViewPSetEqTo.SetReadOnly();
            }
            else
            {
                listViewEqTo.SetEnabled();
                listViewStartWith.SetEnabled();
                listViewContains.SetEnabled();
                listViewPSetEqTo.SetEnabled();
            }
        }
Example #2
0
 /// <summary>
 /// Merge PropertyFilter
 /// </summary>
 /// <param name="mergeFilter">PropertyFilter to merge</param>
 public void Merge(PropertyFilter mergeFilter)
 {
     EqualTo             = EqualTo.Concat(mergeFilter.EqualTo.Where(s => !EqualTo.Contains(s))).ToList();
     StartWith           = StartWith.Concat(mergeFilter.StartWith.Where(s => !StartWith.Contains(s))).ToList();
     Contain             = Contain.Concat(mergeFilter.Contain.Where(s => !Contain.Contains(s))).ToList();
     PropertySetsEqualTo = PropertySetsEqualTo.Concat(mergeFilter.PropertySetsEqualTo.Where(s => !PropertySetsEqualTo.Contains(s))).ToList();
 }
Example #3
0
 /// <summary>
 /// Copy values from passed PropertyFilter
 /// </summary>
 /// <param name="copyFilter">PropertyFilter to copy</param>
 public void Copy(PropertyFilter copyFilter)
 {
     EqualTo.Clear();
     EqualTo = EqualTo.Concat(copyFilter.EqualTo).ToList();
     StartWith.Clear();
     StartWith = StartWith.Concat(copyFilter.StartWith).ToList();
     Contain.Clear();
     Contain = Contain.Concat(copyFilter.Contain).ToList();
     PropertySetsEqualTo.Clear();
     PropertySetsEqualTo = PropertySetsEqualTo.Concat(copyFilter.PropertySetsEqualTo).ToList();
 }
Example #4
0
        /// <summary>
        /// Will read Configuration file if passed, or default COBieAttributesFilters.config
        /// </summary>
        /// <param name="configFileName">Full path/name for config file</param>
        private void FiltersHelperInit(ImportSet import, string configFileName = null)
        {
            string resFile = configFileName;

            //set default
            if (resFile == null)
            {
                resFile = "Xbim.COBieLiteUK.FilterHelper.COBieDefaultFilters.config";
            }

            Configuration config = GetResourceConfig(resFile);

            //IfcProduct and IfcTypeObject filters
            if ((import == ImportSet.All) || (import == ImportSet.IfcFilters))
            {
                IfcProductFilter    = new ObjectFilter(config.GetSection("IfcElementInclusion"));
                IfcTypeObjectFilter = new ObjectFilter(config.GetSection("IfcTypeInclusion"));
                IfcTypeObjectFilter.FillPreDefinedTypes(config.GetSection("IfcPreDefinedTypeFilter"));
                IfcAssemblyFilter = new ObjectFilter(config.GetSection("IfcAssemblyInclusion"));
            }

            //Property name filters
            if ((import == ImportSet.All) || (import == ImportSet.PropertyFilters))
            {
                ZoneFilter      = new PropertyFilter(config.GetSection("ZoneFilter"));
                TypeFilter      = new PropertyFilter(config.GetSection("TypeFilter"));
                SpaceFilter     = new PropertyFilter(config.GetSection("SpaceFilter"));
                FloorFilter     = new PropertyFilter(config.GetSection("FloorFilter"));
                FacilityFilter  = new PropertyFilter(config.GetSection("FacilityFilter"));
                SpareFilter     = new PropertyFilter(config.GetSection("SpareFilter"));
                ComponentFilter = new PropertyFilter(config.GetSection("ComponentFilter"));
                CommonFilter    = new PropertyFilter(config.GetSection("CommonFilter"));
            }


            if (configFileName == null)
            {
                File.Delete(config.FilePath);
            }
        }
Example #5
0
        /// <summary>
        /// Empty constructor for Serialize
        /// </summary>
        public OutPutFilters()
        {
            //will flip filter result from true to false
            FlipResult = false;

            //object filters
            IfcProductFilter    = new ObjectFilter();
            IfcTypeObjectFilter = new ObjectFilter();
            IfcAssemblyFilter   = new ObjectFilter();

            //Property name filters
            ZoneFilter      = new PropertyFilter();
            TypeFilter      = new PropertyFilter();
            SpaceFilter     = new PropertyFilter();
            FloorFilter     = new PropertyFilter();
            FacilityFilter  = new PropertyFilter();
            SpareFilter     = new PropertyFilter();
            ComponentFilter = new PropertyFilter();
            CommonFilter    = new PropertyFilter();

            //role storage
            RolesFilterHolder = new Dictionary <RoleFilter, OutPutFilters>();
        }
Example #6
0
 /// <summary>
 /// Set Up Property Name Exclusions
 /// </summary>
 /// <param name="pSetFilter">PropertySetFilters</param>
 /// <param name="filter">PropertyFilter</param>
 private void SetUpPropertNameLists(PropertySetFilters pSetFilter, PropertyFilter filter)
 {
     pSetFilter.FillLists(filter, ReadOnly);
 }
Example #7
0
 /// <summary>
 /// Copy values from passed PropertyFilter
 /// </summary>
 /// <param name="copyFilter">PropertyFilter to copy</param>
 public void Copy(PropertyFilter copyFilter)
 {
     EqualTo.Clear();
     EqualTo = EqualTo.Concat(copyFilter.EqualTo).ToList();
     StartWith.Clear();
     StartWith = StartWith.Concat(copyFilter.StartWith).ToList();
     Contain.Clear();
     Contain = Contain.Concat(copyFilter.Contain).ToList();
     PropertySetsEqualTo.Clear();
     PropertySetsEqualTo = PropertySetsEqualTo.Concat(copyFilter.PropertySetsEqualTo).ToList();
     
 }
Example #8
0
 /// <summary>
 /// Merge PropertyFilter
 /// </summary>
 /// <param name="mergeFilter">PropertyFilter to merge</param>
 public void Merge (PropertyFilter mergeFilter)
 {
     EqualTo = EqualTo.Concat(mergeFilter.EqualTo.Where(s => !EqualTo.Contains(s))).ToList();
     StartWith = StartWith.Concat(mergeFilter.StartWith.Where(s => !StartWith.Contains(s))).ToList();
     Contain = Contain.Concat(mergeFilter.Contain.Where(s => !Contain.Contains(s))).ToList();
     PropertySetsEqualTo = PropertySetsEqualTo.Concat(mergeFilter.PropertySetsEqualTo.Where(s => !PropertySetsEqualTo.Contains(s))).ToList();
 }