Esempio n. 1
0
 private bool WFNRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(rulePrefix, StringComparison.Ordinal) ||
            r.Name.StartsWith(oldRulePrefix, StringComparison.Ordinal) ||
            r.Name.StartsWith(rulePrefixAlt2, StringComparison.Ordinal) ||
            r.Name.StartsWith(tempRulePrefix, StringComparison.Ordinal));
 }
Esempio n. 2
0
        private void btnRemoveRule_Click(object sender, RoutedEventArgs e)
        {
            if (MessageBox.Show(Common.Properties.Resources.MSG_RULE_DELETE, Common.Properties.Resources.MSG_DLG_TITLE, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
            {
                FirewallHelper.Rule selectedRule = (FirewallHelper.Rule)gridRules.SelectedItem;
                if (!FirewallHelper.RemoveRule(selectedRule.Name))
                {
                    MessageBox.Show(Common.Properties.Resources.MSG_RULE_DELETE_FAILED, Common.Properties.Resources.MSG_DLG_ERR_TITLE, MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }
                allRules.Remove(selectedRule);

                filterRules();
            }
        }
Esempio n. 3
0
 private bool filteredRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.IndexOf(txtFilter.Text, StringComparison.OrdinalIgnoreCase) > -1 || (r.ApplicationName != null && r.ApplicationName.IndexOf(txtFilter.Text, StringComparison.CurrentCultureIgnoreCase) > -1));
 }
Esempio n. 4
0
 private bool activeRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Enabled);
 }
Esempio n. 5
0
 private bool WSHRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(Common.Properties.Resources.RULE_WSH_PREFIX, StringComparison.Ordinal));
 }
Esempio n. 6
0
 private bool WSHRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith("WSH -"));
 }
Esempio n. 7
0
 private bool WFNRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(rulePrefix) || r.Name.StartsWith("[WFN ") || r.Name.EndsWith(tempRuleSuffix));
 }
Esempio n. 8
0
 private bool WFNRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(rulePrefix));
 }