Exemple #1
0
 public Filter(FilterManager filterManager, string id, string name, double value, IInPlaceFilter filter)
 {
     this.filterManager  = filterManager;
     this.Id             = id;
     this.Name           = name;
     this.value          = value;
     this.iInPlaceFilter = filter;
 }
        /// <summary>
        /// Добавить фильтр
        /// </summary>
        /// <param name="name">Имя фильтра</param>
        /// <param name="value">Значение для инициализации</param>
        public void AddFilter(string name, double value = 0)
        {
            if (!filtersNameList.ContainsKey(name))
            {
                throw new Exception("Filter not found!");
            }

            string id = Guid.NewGuid().ToString();

            filters[id] = new Filter(this, id, name, value, FilterManager.SetFilter(name, value));
            Invalidate();
        }
        public FFilterManager(DicomImageViewer.Dicom.FilterManager filterManager)
        {
            InitializeComponent();

            this.FilterManager = filterManager;

            //Получаем список существующих фильтров
            foreach (var item in this.FilterManager.FiltersNameList)
            {
                cbFiltersList.Items.Add(item);
            }
            if (cbFiltersList.Items.Count > 0)
            {
                cbFiltersList.SelectedIndex = 0;
            }
            refreshLbFilters();
        }