Inheritance: System.Windows.Forms.Form, IFieldDisplaySettingsOwner
コード例 #1
0
        private void blacklistAddButton_Click(object sender, EventArgs e)
        {
            if (DBManager == null)
            {
                throw new Exception("DBManager Property must be defined for FilterEditorPane.");
            }

            ItemSelectionPopup popup = new ItemSelectionPopup();

            popup.FieldDisplaySettings.Table           = FieldDisplaySettings.Table;
            popup.FieldDisplaySettings.FieldProperties = FieldDisplaySettings.FieldProperties;
            popup.ItemList.DatabaseObjects.AddRange(DBManager.Get(FieldDisplaySettings.Table, null));

            foreach (DatabaseTable currItem in whiteList.DatabaseObjects)
            {
                popup.ItemList.DatabaseObjects.Remove(currItem);
            }

            foreach (DatabaseTable currItem in blackList.DatabaseObjects)
            {
                popup.ItemList.DatabaseObjects.Remove(currItem);
            }


            popup.ShowDialog();

            if (popup.ExitStatus == ItemSelectionPopup.ExitStatusEnum.OK)
            {
                blackList.DatabaseObjects.AddRange(popup.ItemList.SelectedDatabaseObjects);
                foreach (DatabaseTable currItem in popup.ItemList.SelectedDatabaseObjects)
                {
                    _attachedFilter.BlackList.Add((T)currItem);
                }
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (DBManager == null)
            {
                throw new Exception("DBManager Property must be defined for FilterEditorPane.");
            }

            ItemSelectionPopup popup = new ItemSelectionPopup();

            popup.FieldDisplaySettings.Table           = FieldDisplaySettings.Table;
            popup.FieldDisplaySettings.FieldProperties = FieldDisplaySettings.FieldProperties;
            popup.ShowCancelButton = false;
            popup.Text             = "Results";

            List <T>    allItems      = DBManager.Get <T>(null);
            HashSet <T> filteredItems = _attachedFilter.Filter(allItems);

            foreach (T currItem in filteredItems)
            {
                popup.ItemList.DatabaseObjects.Add(currItem);
            }

            popup.ShowDialog();
        }