File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
WindowsFirewallHelper.Net5Sample
WindowsFirewallHelper.Sample Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ private static void NodeDiscovery(TreeNode node)
2727
2828 node . Nodes . Clear ( ) ;
2929
30- if ( o is ICollection < FirewallWASRule > || o is ICollection < IFirewallRule > )
30+ if ( o is ICollection < FirewallWASRule > or ICollection < IFirewallRule > )
3131 {
3232 foreach ( var item in ( ( IEnumerable ) o ) . Cast < IFirewallRule > ( ) . OrderBy ( rule => rule . FriendlyName ) )
3333 {
@@ -48,7 +48,7 @@ private static void NodeDiscovery(TreeNode node)
4848 if ( propertyInfo . PropertyType . GetInterfaces ( ) . Contains ( typeof ( IEnumerable ) ) &&
4949 propertyInfo . PropertyType != typeof ( string ) )
5050 {
51- if ( ! propertyInfo . GetGetMethod ( ) . IsStatic )
51+ if ( propertyInfo . GetGetMethod ( ) ? . IsStatic == false )
5252 {
5353 var value = propertyInfo . GetValue ( o , null ) ;
5454 node . Nodes . Add ( new TreeNode ( "[" + propertyInfo . Name + "] " ) { Tag = value } ) ;
@@ -76,7 +76,7 @@ private void AddApplicationRule(object sender, EventArgs e)
7676
7777 var newAppRule = FirewallManager . Instance . CreateApplicationRule (
7878 profileType . Value ,
79- "!!TETS !! " + Guid . NewGuid ( ) . ToString ( "B" ) ,
79+ "!!TEST !! " + Guid . NewGuid ( ) . ToString ( "B" ) ,
8080 FirewallAction . Allow ,
8181 ofd_app . FileName
8282 ) ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ private void AddApplicationRule(object sender, EventArgs e)
7676
7777 var newAppRule = FirewallManager . Instance . CreateApplicationRule (
7878 profileType . Value ,
79- "!!TETS !! " + Guid . NewGuid ( ) . ToString ( "B" ) ,
79+ "!!TEST !! " + Guid . NewGuid ( ) . ToString ( "B" ) ,
8080 FirewallAction . Allow ,
8181 ofd_app . FileName
8282 ) ;
Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFrameworks >netstandard2;net4;net5.0</TargetFrameworks >
55 <PackageId >WindowsFirewallHelper</PackageId >
6- <Version >2.1.4.81 </Version >
6+ <Version >2.2.0.86 </Version >
77 <Authors >Soroush Falahati</Authors >
88 <Description >A class library to manage the Windows Firewall as well as adding your program to the Windows Firewall Exception list. Supporting Windows XP+.</Description >
99 <PackageLicenseUrl >https://github.com/falahati/WindowsFirewallHelper/blob/master/LICENSE</PackageLicenseUrl >
2121 <PrivateAssets >all</PrivateAssets >
2222 <IncludeAssets >runtime; build; native; contentfiles; analyzers</IncludeAssets >
2323 </PackageReference >
24- <Reference Condition =" '$(TargetFramework)'=='net4'" Include =" System.ServiceProcess" ></Reference >
2524 </ItemGroup >
2625 <ItemGroup >
2726 <Content Include =" Icon.png" >
3332 <PackagePath >\</PackagePath >
3433 </Content >
3534 </ItemGroup >
36- <ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2'" >
37- <PackageReference Include =" System.ServiceProcess.ServiceController" >
38- <Version >5.0.0</Version >
39- </PackageReference >
35+ <ItemGroup Condition =" '$(TargetFramework)' == 'net4'" >
36+ <Reference Include =" System.ServiceProcess" ></Reference >
4037 </ItemGroup >
41- <ItemGroup Condition =" '$(TargetFramework)' == 'net5.0 '" >
38+ <ItemGroup Condition =" '$(TargetFramework)' != 'net4 '" >
4239 <PackageReference Include =" System.ServiceProcess.ServiceController" >
4340 <Version >5.0.0</Version >
4441 </PackageReference >
You can’t perform that action at this time.
0 commit comments