Skip to content

Commit b078279

Browse files
committed
adding .net 8 and 9 with net 48
1 parent 48c59ec commit b078279

File tree

18 files changed

+309
-619
lines changed

18 files changed

+309
-619
lines changed

Src/SamplesByPlatforms/Xceed.Blazor.Zip.Sample/Components/Layout/MainLayout.razor.css

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,28 @@ main {
2727
text-decoration: none;
2828
}
2929

30-
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31-
text-decoration: underline;
32-
}
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
3333

34-
.top-row ::deep a:first-child {
35-
overflow: hidden;
36-
text-overflow: ellipsis;
37-
}
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
3838

3939
@media (max-width: 640.98px) {
40+
.sidebar {
41+
background-image: linear-gradient(90deg, rgb(0, 0, 0) 0%, #FE671A 150%);
42+
}
43+
4044
.top-row {
45+
background-image: linear-gradient(90deg, rgb(0, 0, 0) 0%, #FE671A 150%);
4146
justify-content: space-between;
4247
}
4348

44-
.top-row ::deep a, .top-row ::deep .btn-link {
45-
margin-left: 0;
46-
}
49+
.top-row ::deep a, .top-row ::deep .btn-link {
50+
margin-left: 0;
51+
}
4752
}
4853

4954
@media (min-width: 641px) {
@@ -64,11 +69,11 @@ main {
6469
z-index: 1;
6570
}
6671

67-
.top-row.auth ::deep a:first-child {
68-
flex: 1;
69-
text-align: right;
70-
width: 0;
71-
}
72+
.top-row.auth ::deep a:first-child {
73+
flex: 1;
74+
text-align: right;
75+
width: 0;
76+
}
7277

7378
.top-row, article {
7479
padding-left: 2rem !important;

Src/SamplesByPlatforms/Xceed.Blazor.Zip.Sample/Components/Layout/NavMenu.razor

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<div class="top-row ps-3 navbar navbar-dark">
1+
<div class="top-row ps-0 navbar navbar-dark">
22
<div class="container-fluid">
3-
<img src="images/logox.png" alt="Logo" width="40" height="40" />
4-
<a class="navbar-brand" href="">Xceed Zip Sample</a>
3+
<div>
4+
<img src="images/logox.png" alt="Logo" width="40" height="40" />
5+
<a class="navbar-brand" href="">Xceed Zip Samples</a>
6+
</div>
57
</div>
68
</div>
79

@@ -20,6 +22,12 @@
2022
List element
2123
</NavLink>
2224
</div>
25+
26+
<div class="nav-item px-3">
27+
<NavLink class="nav-link" href="folderzip" style="font-weight: bold;">
28+
compress folder
29+
</NavLink>
30+
</div>
2331
</nav>
2432
</div>
2533

Src/SamplesByPlatforms/Xceed.Blazor.Zip.Sample/Components/Pages/FolderZip.razor

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
try
3333
{
34+
CopyDirectory( selectedFolder, tempFolderPath, true );
35+
3436
// Create temporary folder and copy selected folder contents
3537
if( Directory.Exists( tempFolderPath ) )
3638
{
@@ -78,4 +80,37 @@
7880
}
7981
}
8082
}
83+
84+
static void CopyDirectory( string sourceDir, string destinationDir, bool recursive )
85+
{
86+
// Get information about the source directory
87+
var dir = new DirectoryInfo( sourceDir );
88+
89+
// Check if the source directory exists
90+
if( !dir.Exists )
91+
throw new DirectoryNotFoundException( $"Source directory not found: {dir.FullName}" );
92+
93+
// Cache directories before we start copying
94+
DirectoryInfo[] dirs = dir.GetDirectories();
95+
96+
// Create the destination directory
97+
Directory.CreateDirectory( destinationDir );
98+
99+
// Get the files in the source directory and copy to the destination directory
100+
foreach( FileInfo file in dir.GetFiles() )
101+
{
102+
string targetFilePath = Path.Combine( destinationDir, file.Name );
103+
file.CopyTo( targetFilePath );
104+
}
105+
106+
// If recursive and copying subdirectories, recursively call this method
107+
if( recursive )
108+
{
109+
foreach( DirectoryInfo subDir in dirs )
110+
{
111+
string newDestinationDir = Path.Combine( destinationDir, subDir.Name );
112+
CopyDirectory( subDir.FullName, newDestinationDir, true );
113+
}
114+
}
115+
}
81116
}

Src/SamplesByPlatforms/Xceed.Blazor.Zip.Sample/Xceed.Blazor.Zip.Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

Src/SamplesByPlatforms/Xceed.Console.Zip.Sample/Xceed.Console.Zip.Sample.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Pastel" Version="5.1.0" />
11+
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.26100.1742" />
12+
<PackageReference Include="Pastel" Version="6.0.1" />
1213
<PackageReference Include="Xceed.Products.Zip.Full" Version="7.1.24152.2253" />
1314
</ItemGroup>
1415

Src/SamplesByPlatforms/Xceed.Wpf.Zip.Sample/App.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

Src/SamplesByPlatforms/Xceed.Wpf.Zip.Sample/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Application x:Class="Xceed.Wpf.Zip.Sample.App"
1+
<Application x:Class="Xceed.Wpf.Zip.Sample.Net.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:Xceed.Wpf.Zip.Sample"
4+
xmlns:local="clr-namespace:Xceed.Wpf.Zip.Sample.Net"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
77

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
1+
using System.Configuration;
42
using System.Data;
5-
using System.Linq;
6-
using System.Threading.Tasks;
73
using System.Windows;
84

9-
namespace Xceed.Wpf.Zip.Sample
5+
namespace Xceed.Wpf.Zip.Sample.Net
106
{
11-
/// <summary>
12-
/// Interaction logic for App.xaml
13-
/// </summary>
14-
public partial class App : Application
15-
{
16-
}
7+
/// <summary>
8+
/// Interaction logic for App.xaml
9+
/// </summary>
10+
public partial class App : System.Windows.Application
11+
{
12+
}
13+
1714
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

Src/SamplesByPlatforms/Xceed.Wpf.Zip.Sample/MainWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
mc:Ignorable="d"
88
Title="Xceed Zip Sample for WPF"
99
Height="450"
10-
Background="#101010"
11-
Icon="logox.ico"
10+
Background="#101010"
11+
Icon="/logox.ico"
1212
Width="800">
1313
<Grid>
1414
<Grid.ColumnDefinitions>
@@ -18,9 +18,9 @@
1818
<StackPanel Orientation="Vertical"
1919
HorizontalAlignment="Center"
2020
Margin="10,10,0,0">
21-
<TextBlock Text="Select a button to check how Xceed.Zip works!!!"
21+
<TextBlock Text="Select a button to check how Xceed.Zip works!!!"
2222
Foreground="White"
23-
FontSize="16"/>
23+
FontSize="16" />
2424
<Button Name="CompressFileButton"
2525
HorizontalAlignment="Left"
2626
Width="220"

0 commit comments

Comments
 (0)