/// <summary> /// Prepares the call back. /// </summary> /// <returns>ZipUserFunctions stucture</returns> internal ZipUserFunctions PrepareCallBack() { zuf = new ZipUserFunctions(); zuf.PrintCallbackFunction = new PrintCallbackDelegate(ProcessPrintCallback); zuf.ServiceCallbackFunction = new ServiceCallbackDelegate(ProcessServiceMessage); zuf.PasswordCallbackFunction = new PasswordCallbackDelegate(ProcessPasswordCallback); zuf.CommentCallbackFunction = new CommentCallbackDelegate(ProcessCommentCallback); return(zuf); }
internal bool ProcessFiles(string[] fileMask, ZipOptions zopt) { int iret; ZipError zipError; if (string.IsNullOrEmpty(FileName)) { return(false); } if (fileMask.Length == 0) { return(false); } ZipUserFunctions zuf = PrepareCallBack(); try { iret = NativeMethods.ZpInit(ref zuf); } catch (DllNotFoundException) { return(false); } if (iret == 0) { return(false); } try { zipError = NativeMethods.ZpSetOptions(ref zopt); zipError = NativeMethods.ZpArchive(fileMask.Length, fileName, fileMask); } catch (DllNotFoundException) { return(false); } return(zipError == ZipError.ZE_OK); }
public static extern int ZpInit(ref ZipUserFunctions zuf);