Skip to content

Commit 48c59ec

Browse files
2 parents 74617e7 + 741975e commit 48c59ec

File tree

1 file changed

+104
-57
lines changed

1 file changed

+104
-57
lines changed

README.md

Lines changed: 104 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For more information, please visit the [official product page](https://xceed.com
2525
- Supports the latest zip file format standards
2626
- Used and trusted by Microsoft in their server products
2727
- Supports .NET 4.5, 5, 6 and 7 (including .NET core and .NET Standard)
28-
-
28+
2929
## Getting Started with the Xceed Zip for .NET
3030

3131
To get started, clone this repository and explore the various sample projects provided. Each sample demonstrates different features and capabilities of Xceed Zip for .NET.
@@ -35,7 +35,7 @@ To get started, clone this repository and explore the various sample projects pr
3535
- .NET Framework 4.0 or later
3636
- .NET 5.0 or later
3737

38-
### 1. Installing the DataGrid from nuget
38+
### 1. Installing the Zip for .NET from nuget
3939
To install the Xceed Zip for .NET from NuGet, follow these steps:
4040

4141
1. **Open your project in Visual Studio.**
@@ -53,28 +53,100 @@ To install the Xceed Zip for .NET from NuGet, follow these steps:
5353

5454
![Nuget library](./Resources/nuget_sample.png)
5555

56-
### 2. Adding a DataGrid to the XAML
56+
### 2. Refering Xceed Zip for .NET library
5757

58-
To add a DataGrid to your XAML, follow these steps:
58+
1. **Add the reference with using statement at the top of the class**
59+
```
60+
using Xceed.Zip;
61+
```
62+
63+
2. **Use the classes and elements from the namespace**
64+
```c#
65+
using Xceed.Zip;
5966

60-
1. **Open your XAML file (e.g., MainWindow.xaml).**
61-
2. **Add the following namespace at the top of your XAML file:**
62-
```xaml
63-
xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
67+
namespace BlazeDocX.Services
68+
{
69+
public class ZipSample
70+
{
71+
public void QuickZipSample()
72+
{
73+
QuickZip.Zip( @"d:\test.zip", @"d:\file.txt" );
74+
}
75+
76+
public void QuickUnZipSample()
77+
{
78+
QuickZip.Unzip( @"d:\test.zip", @"d:\", true, true, false, "*" );
79+
}
80+
81+
public QuickZipItem[] QuickGetContent()
82+
{
83+
QuickZipItem[] items = QuickZip.GetZipContents( @"c:\test.zip", "*" );
84+
return items;
85+
}
86+
87+
public void QuickRemoveZip()
88+
{
89+
QuickZip.Remove( @"d:\test\files.zip", "old*" );
90+
}
91+
}
92+
}
6493
```
65-
3. **Add the DataGrid control to your layout:**
66-
```xaml
67-
<xcdg:DataGridControl x:Name="myDataGrid"
68-
AutoCreateColumns="True"
69-
ItemsSource="{Binding YourDataSource}" />
94+
95+
### 3. A quick sample
96+
97+
How to Zip and UnZip a file in .NET C# in seconds!
98+
99+
Xceed Zip for .NET makes manipulating Zip files in C# very easy and simple.
100+
101+
First launched in 2002 for .NET 1.0, Xceed Zip for .NET has been updated frequently ever since by our developers. It allows to quickly Zip and Unzip files using C# or Visual Basic for .NET code.
102+
103+
Note that the following example is done in C#, but that the Visual Basic for .NET code will be very similar.
104+
105+
Also note that this code is compatible with .NET Standard, .NET Core, .NET 5 and .NET 6. Should you have an older project that also needs help from Xceed Zip for .NET, it is also compatible with all legacy versions of the .NET Framework.
106+
107+
So let's get to it!
108+
109+
There are 2 ways we can go about compressing. The easiest way is to use our QuickZip class.
110+
111+
If your scenarios are simple, this may just be the solution you need:
112+
113+
```csharp
114+
Xceed.Zip.QuickZip.Zip(@"c:ResultZipZippedFile.zip", true, true, false, @"c:FilesToZip*.*");
70115
```
71-
4. Ensure your DataContext is set to an appropriate data source in your code-behind or ViewModel.
116+
117+
To find all the different options and parameters related to this class, go [here](https://doc.xceed.com/xceed-filesystem-for-net/topic9402.html).
118+
119+
As you just saw, you can create a zip archive from a file or folder using just 1 line of code. Isn't that fantastic!
120+
121+
Xceed Zip for .NET is pretty much limitless and is very flexible. Here's a more complex example:
122+
123+
```csharp
124+
//Zip Archive Approach
125+
ZipArchive zipFile = new ZipArchive(new DiskFile(@"c:ResultZipZippedFileArchive.zip"));
126+
DiskFolder folder = new DiskFolder(@"c:FilesToZip");
127+
folder.CopyFilesTo(zipFile, true, true);
128+
```
129+
130+
To UnZip, simply do the operations in reverse. It really is that simple and easy!
131+
```csharp
132+
Xceed.Zip.QuickZip.Unzip(...)
133+
```
134+
Same as the Zip Archive approach, but this time you do the reverse operations:
135+
```csharp
136+
ZipArchive zipFile = new ZipArchive(new DiskFile(@"c:ResultZipZippedFileArchive.zip"));
137+
DiskFolder folder = new DiskFolder(@"c:FilesToZip");
138+
zipFile2.CopyFilesTo(folder , true, true);
139+
```
140+
141+
Xceed Zip for .NET offers a ton more functionalities! If you need more information, all functionalities are documented [here](https://doc.xceed.com/xceed-filesystem-for-net/webframe.html#topic87.html) (including encryption and different compression algorithms):
72142

73-
### 3. How to License the Product Using the LicenseKey Property
143+
### 4. How to License the Product Using the LicenseKey Property
74144
To license the Xceed Zip for .NET using the LicenseKey property, follow these steps:
75145

76146
1. **Obtain your license key** from Xceed. (Download the product from xceed.com or send us a request at [email protected]
77147
2. **Set the LicenseKey property in your application startup code:**
148+
149+
2.1 In case of WPF or Desktop app could be in the MainWindow
78150
```csharp
79151
using System.Windows;
80152

@@ -83,56 +155,31 @@ To license the Xceed Zip for .NET using the LicenseKey property, follow these st
83155
public MainWindow()
84156
{
85157
InitializeComponent();
86-
Xceed.Wpf.DataGrid.Licenser.LicenseKey = "Your-Key-Here";
158+
Xceed.Zip.Licenser.LicenseKey = "XXXX-XXXX-XXXX-XXXX";
87159
}
88160
}
89161
```
90-
3. Ensure the license key is set before any DataGrid control is instantiated.
91-
92-
## Examples Overview
93-
94-
Below is a list of the examples available in this repository:
95-
96-
- **AsyncBinding**: Demonstrates how to bind the DataGrid asynchronously.
97-
- **BatchUpdating**: Shows how to perform batch updates in the DataGrid.
98-
- **CardView**: Provides an example of displaying data in a card view layout.
99-
- **ColumnChooser**: Demonstrates how to implement a column chooser for the DataGrid.
100-
- **ColumnManagerRow**: Shows how to use a column manager row.
101-
- **CustomFiltering**: Demonstrates custom filtering techniques.
102-
- **CustomViews**: Provides examples of custom views in the DataGrid.
103-
- **DataVirtualization**: Shows how to use data virtualization to enhance performance.
104-
- **EditModes**: Demonstrates various edit modes available in the DataGrid.
105-
- **Exporting**: Provides examples of exporting data to different formats.
106-
- **FlexibleBinding**: Shows how to bind data flexibly.
107-
- **FlexibleRowsColumn**: Demonstrates flexible row and column configurations.
108-
- **Formatting**: Provides examples of data formatting.
109-
- **Grouping**: Demonstrates grouping data in the DataGrid.
110-
- **IncludedEditors**: Shows how to use included editors.
111-
- **LargeDataSets**: Demonstrates handling large datasets.
112-
- **LiveUpdating**: Shows how to update data live.
113-
- **MasterDetail**: Demonstrates master-detail views.
114-
- **MergedHeaders**: Shows how to create merged headers.
115-
- **MultiView**: Demonstrates multiple view configurations.
116-
- **MVVM**: Provides examples of using MVVM pattern with the DataGrid.
117-
- **PersistSettings**: Shows how to persist settings.
118-
- **Printing**: Demonstrates printing capabilities.
119-
- **Selection**: Shows how to handle selection in the DataGrid.
120-
- **SpannedCells**: Demonstrates cell spanning techniques.
121-
- **SummariesAndTotals**: Shows how to implement summaries and totals.
122-
- **Tableflow**: Demonstrates table flow layout.
123-
- **TableView**: Shows how to use the table view.
124-
- **Theming**: Demonstrates theming capabilities.
125-
- **TreeGridflowView**: Shows how to implement a tree grid flow view.
126-
- **Validation**: Demonstrates data validation techniques.
127-
- **Views3D**: Provides examples of 3D views.
162+
2.2 In case of ASP.NET application must be in Program.cs class
163+
```csharp
164+
using System.Net;
165+
using System.Text.Json;
166+
using System.Text.Json.Serialization;
167+
...
168+
using Xceed.Document.NET;
169+
...
170+
Xceed.Zip.Licenser.LicenseKey = "XXXX-XXXX-XXXX-XXXX";
171+
...
172+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
173+
```
174+
4. Ensure the license key is set before any Zip class, instance or similar control is instantiated.
128175

129176
## Getting Started with the Samples
130177

131178
To get started with these examples, clone the repository and open the solution file in Visual Studio.
132179

133180
```bash
134-
git clone https://github.com/your-repo/xceed-datagrid-wpf-examples.git
135-
cd xceed-datagrid-wpf-examples
181+
git clone https://github.com/your-repo/Xceed-Zip-Samples.git
182+
cd xceed-zip-samples
136183
```
137184
Open the solution file in Visual Studio and build the project to restore the necessary NuGet packages.
138185

@@ -143,7 +190,7 @@ Open the solution file in Visual Studio and build the project to restore the nec
143190

144191
## Documentation
145192

146-
For more information on how to use the Xceed Zip for .NET, please refer to the [official documentation](https://doc.xceed.com/xceed-datagrid-for-wpf/webframe.html#rootWelcome.html).
193+
For more information on how to use the Xceed Zip for .NET, please refer to the [official documentation](https://doc.xceed.com/xceed-filesystem-for-net/webframe.html#topic46.html).
147194

148195
## Licensing
149196

0 commit comments

Comments
 (0)