/// <summary> /// Raises the <see cref="FileReplace"/> event. /// </summary> /// <param name="e">The <see cref="Karna.Compression.FileReplaceEventArgs"/> instance containing the event data.</param> protected virtual void OnFileReplace(FileReplaceEventArgs e) { if (FileReplace != null) { FileReplace(this, e); } }
/// <summary> /// Processes the replace callback. /// </summary> /// <param name="msg">The message.</param> /// <param name="x">The length of the message text.</param> /// <returns> /// Return code that tells to unzip what to do when the file already exists /// </returns> internal int ProcessReplaceCallback(ref CallbackString msg, uint x) { string s = InternalHelper.PCharToString(msg.Buffer); FileReplaceEventArgs e = new FileReplaceEventArgs(s, FileReplaceOption.OverwriteFile); OnFileReplace(e); return(InternalHelper.ReplaceOptionToCode(e.Option)); }