예제 #1
0
        private void deleteRule_Click(object sender, RoutedEventArgs e)
        {
            var rule = (Rule)listRules.SelectedItem;

            ruleManager = new RuleManager();
            ruleManager.DeleteRule(rule);
            UpdateRule?.Invoke();
        }
예제 #2
0
        void bwDelete_DoWork(object sender, DoWorkEventArgs e)
        {
            var deletedItems = new List <ListViewItem>();

            var rm = new RuleManager(entityName, service);

            foreach (ListViewItem item in (ListView.SelectedListViewItemCollection)e.Argument)
            {
                var rule = (Entity)item.Tag;

                rm.DeleteRule(rule.Id);

                deletedItems.Add(item);
            }

            e.Result = deletedItems;
        }
예제 #3
0
        private void bwDelete_DoWork(object sender, DoWorkEventArgs e)
        {
            var deletedItems = new List <ListViewItem>();

            var rm = new RuleManager(entityName, service, connectionDetail);

            Invoke(new Action(() =>
            {
                foreach (ListViewItem item in (ListView.SelectedListViewItemCollection)e.Argument)
                {
                    var rule = (Entity)item.Tag;

                    rm.DeleteRule(rule.Id);

                    deletedItems.Add(item);
                }
            }));

            e.Result = deletedItems;
        }