コード例 #1
0
ファイル: frmMain.cs プロジェクト: 0ffffffffh/yald
        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");
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: 0ffffffffh/yald
        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");
            }
        }