Exemple #1
0
        private string RecursivelyListAllFilterNames(IContainer filterContainer)
        {
            if (filterContainer == null)
            {
                return("");
            }

            string toReturn = "";

            if (filterContainer.GetSubContainers() != null)
            {
                foreach (IContainer subContainer in filterContainer.GetSubContainers())
                {
                    toReturn += RecursivelyListAllFilterNames(subContainer);
                }
            }

            if (filterContainer.GetFilters() != null)
            {
                foreach (IFilter f in filterContainer.GetFilters())
                {
                    toReturn += f.Name + ',';
                }
            }

            return(toReturn);
        }
Exemple #2
0
        public IFilter CreateFilter(IFilterFactory factory, IContainer filterContainer, IFilter[] alreadyExisting)
        {
            var importer  = new FilterImporter(factory, null);
            var newFilter = importer.ImportFilter(filterContainer, _filter, alreadyExisting);

            foreach (SimpleParameterUI parameterUi in parameterUis)
            {
                parameterUi.HandleSettingParameters(newFilter);
            }

            //if there are known good values
            if (ddKnownGoodValues.SelectedItem != null && ddKnownGoodValues.SelectedItem as string != string.Empty)
            {
                newFilter.Name += "_" + ddKnownGoodValues.SelectedItem;
            }


            newFilter.FilterContainer_ID = filterContainer.ID;
            newFilter.SaveToDatabase();

            return(newFilter);
        }