Microsoft Developer Network >
Domovská stránka fór
>
MSDN Online: Future Plans
>
Idle Comment from the Peanut Gallery
Idle Comment from the Peanut Gallery
Greetings,
I dunno what it is, but perhaps i feel the urge to develop as many things in such a wide range for others to use. Sure there are occasional times where a Friend or Private class/structure is necessary, even useful, but the sheer volume of such classes that exist in the .Net framework is pathetic.
In a class that sometimes needs to pass multiple data structures asynchronously within itself (like Net.Mail.SendAsync()) , it is appropriate that since all of this is in the private scope of the class, to create a quick private class/structure within that lets you pass three different values to the UserState object of the Asynchronous method. This makes sense.
But there I am trying to find a non-external method of creating a zip file. I could use the Shell32 method, creating the quick byte header of a zip file and then linking a Shell32.Folder object to it, and moving the files into that folder uses the Shell32 for XP to "zip" it. Or, to use a .Net method I could use the IO.Packages.ZipPackage found in the WindowsBase.dll.
However, the Shell32 method requires the Interop.Shell32.dll file to be included with my application, which i find annoyingly redundant with regards to COM and it's design, which with any other language framework that utilizes it doesn't require an "interim" dll to interface with the default dll. I can understand using that interim dll for type checking during development, but once the app is compiled it should just link directly to shell32.dll in the system directory.
Additionally the IO.Packages.ZipPackage works great, is completely internal so no additional assemblies need to be included with my application, but on the other side of annoying it adds this [Contenttypes].xml file to every zip it creates which could be confusing to those who end up having to extract the useful files from the Zip file.
There are of course countless Zip Libraries out there, DotNetZip is one that I've found that is very good, and donation ware to boot. But that is again an additional Assembly that would need to be included with my application, either in the install or combined via ILMerge.
So i thought, well, i only want a simple zip created, a few files on the fly, with no excessive accoutrement, and so I go into .Net Reflector to see if I can figure out how the ZipPackage works, to see if this is something I could code myself quickly and easily...and what do i find:- Namespace MS.Internal.IO.Zip
- Friend Class ZipArchive
Oh well, Perhaps if I point this out to the good people at Microsoft it could be a great day to have an update of the 3.0 framework that exposes these internal namespaces and classes so that others may use them as well...doubt it.
Just an idle comment...cheers!
__________________
Jaeden "Sifo Dyas" al'Raec Ruiner
http://www.wayoftheleaf.net/

