Exemplo 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));
 }
Exemplo 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();
            }
        }
Exemplo 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));
 }
Exemplo n.º 4
0
 private bool activeRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Enabled);
 }
Exemplo n.º 5
0
 private bool WSHRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(Common.Properties.Resources.RULE_WSH_PREFIX, StringComparison.Ordinal));
 }
Exemplo n.º 6
0
 private bool WSHRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith("WSH -"));
 }
Exemplo n.º 7
0
 private bool WFNRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(rulePrefix) || r.Name.StartsWith("[WFN ") || r.Name.EndsWith(tempRuleSuffix));
 }
Exemplo n.º 8
0
 private bool WFNRulesPredicate(FirewallHelper.Rule r)
 {
     return(r.Name.StartsWith(rulePrefix));
 }