Exemple #1
0
        private void addNewFilterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TabContent NewTabContentObj;
            string     Name;
            FilterList List;
            bool       LinkState;

            UserFilterObject UserFilter;

            frmNewFilter filter = new frmNewFilter();

            filter.ShowDialog();

            if (filter.GetFilterList() == null)
            {
                return;
            }

            Name      = filter.GetFilterName();
            List      = filter.GetFilterList();
            LinkState = filter.GetLinkState();

            UserFilter = new UserFilterObject(List, Name, LinkState);

            UserFilters.Add(UserFilter);
            UserFilterObject.SaveFilters(UserFilters, "filter.flt");


            NewTabContentObj = AddNewTab(Name, true);

            logcat.AddSlot(Name, List).LinkUi(NewTabContentObj);
        }
Exemple #2
0
        private void filtersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GenericArrayList <UserFilterObject> RemovedObjects;
            TabPage CurrTab;

            frmFilters FiltersDlg = new frmFilters(UserFilters);

            FiltersDlg.ShowDialog();

            RemovedObjects = FiltersDlg.GetRemovedObjects();

            if (RemovedObjects.Count > 0)
            {
                //perform real deleting operation

                foreach (UserFilterObject filter in RemovedObjects)
                {
                    logcat.RemoveSlot(filter.Name);

                    for (int i = 0; i < tbFilterContainer.TabPages.Count; i++)
                    {
                        CurrTab = tbFilterContainer.TabPages[i];

                        if (CurrTab.Text == filter.Name)
                        {
                            tbFilterContainer.TabPages.Remove(CurrTab);
                            CurrTab.Dispose();
                        }
                    }
                }

                RemovedObjects.Clear();

                UserFilterObject.SaveFilters(UserFilters, "filter.flt");
            }
        }