Skip to content

Commit e14a9bf

Browse files
Feature: Option to show all Windows Firewall rules (#3630)
* Feature: Option to show all Windows Firewall rules * Feature: Improve network manager rule handling * Chore: Use correct order * Chore: Feedback from copilot --------- Co-authored-by: BornToBeRoot <16019165+BornToBeRoot@users.noreply.github.com>
1 parent e2a9981 commit e14a9bf

28 files changed

Lines changed: 1554 additions & 116 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System.Collections.Generic;
2+
using System.Collections.ObjectModel;
3+
using System.Collections.Specialized;
4+
using System.ComponentModel;
5+
6+
namespace NETworkManager.Controls;
7+
8+
/// <summary>
9+
/// <see cref="ObservableCollection{T}"/> that can replace all items at once with a single
10+
/// <see cref="NotifyCollectionChangedAction.Reset"/> notification (instead of one notification per item).
11+
/// Bound views (e.g. a filtered / sorted <see cref="System.ComponentModel.ICollectionView"/>) are refreshed only once,
12+
/// which is much faster for large lists.
13+
/// </summary>
14+
/// <typeparam name="T">The type of the items.</typeparam>
15+
public class ObservableRangeCollection<T> : ObservableCollection<T>
16+
{
17+
/// <summary>
18+
/// Replaces all items with the given items and raises a single
19+
/// <see cref="NotifyCollectionChangedAction.Reset"/> notification.
20+
/// </summary>
21+
/// <param name="items">The new items.</param>
22+
public void ReplaceAll(IEnumerable<T> items)
23+
{
24+
CheckReentrancy();
25+
26+
Items.Clear();
27+
28+
foreach (var item in items)
29+
Items.Add(item);
30+
31+
OnPropertyChanged(new PropertyChangedEventArgs(nameof(Count)));
32+
OnPropertyChanged(new PropertyChangedEventArgs("Item[]"));
33+
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
34+
}
35+
}

‎Source/NETworkManager.Documentation/DocumentationManager.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ public static DocumentationIdentifier GetIdentifierBySettingsName(SettingsName n
272272
SettingsName.WebConsole => GetIdentifierByApplicationName(ApplicationName.WebConsole),
273273
SettingsName.SNMP => GetIdentifierByApplicationName(ApplicationName.SNMP),
274274
SettingsName.SNTPLookup => GetIdentifierByApplicationName(ApplicationName.SNTPLookup),
275+
SettingsName.Firewall => GetIdentifierByApplicationName(ApplicationName.Firewall),
275276
SettingsName.WakeOnLAN => GetIdentifierByApplicationName(ApplicationName.WakeOnLAN),
276277
SettingsName.RDAP => GetIdentifierByApplicationName(ApplicationName.RDAP),
277278
SettingsName.BitCalculator => GetIdentifierByApplicationName(ApplicationName.BitCalculator),

‎Source/NETworkManager.Localization/Resources/Strings.Designer.cs‎

Lines changed: 195 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)