protected void SetDefaultOutboundAction(FirewallRule.Actions Action) { for (int i = 0; i < FwProfiles.Length; i++) { SetDefaultOutboundAction(FwProfiles[i], Action); } }
public void CheckAction(FirewallRule.Actions action) { switch (action) { case FirewallRule.Actions.Undefined: State = States.UnRuled; break; case FirewallRule.Actions.Allow: if (FwEvent.Action == FirewallRule.Actions.Allow) { State = LogEntry.States.RuleAllowed; } else { State = LogEntry.States.RuleError; } break; case FirewallRule.Actions.Block: if (FwEvent.Action == FirewallRule.Actions.Block) { State = LogEntry.States.RuleBlocked; } else { State = LogEntry.States.RuleError; } break; } }
private void cmbConTypes_SelectionChanged(object sender, SelectionChangedEventArgs e) { evetnFilter = (FirewallRule.Actions)cmbConTypes.SelectedIndex; cmbConTypes.Background = (cmbConTypes.SelectedItem as ComboBoxItem).Background; App.SetConfig("FwLog", "Events", (int)evetnFilter); //UpdateConnections(true); logGrid.Items.Filter = new Predicate <object>(item => LogFilter(item)); }
private void CmbAction_SelectionChanged(object sender, SelectionChangedEventArgs e) { actionFilter = (FirewallRule.Actions)cmbAction.SelectedIndex; cmbAction.Background = (cmbAction.SelectedItem as ComboBoxItem).Background; App.SetConfig("FwRules", "Actions", (int)actionFilter); //UpdateRules(true); rulesGrid.Items.Filter = new Predicate <object>(item => RuleFilter(item)); }
protected bool TestDefaultOutboundAction(FirewallRule.Actions Action) { for (int i = 0; i < FwProfiles.Length; i++) { if (GetDefaultOutboundAction(FwProfiles[i]) != Action) { return(false); } } return(true); }
public void SetDefaultOutboundAction(FirewallRule.Profiles profileType, FirewallRule.Actions Action) { NetFwPolicy.set_DefaultOutboundAction((NET_FW_PROFILE_TYPE2_)profileType, Action == FirewallRule.Actions.Block ? NET_FW_ACTION_.NET_FW_ACTION_BLOCK : NET_FW_ACTION_.NET_FW_ACTION_ALLOW); }