コード例 #1
0
        /// <summary>
        /// Convert file replace option to integer code
        /// </summary>
        /// <param name="option">The replace option.</param>
        /// <returns>Integer code</returns>
        public static int ReplaceOptionToCode(FileReplaceOption option)
        {
            int res;

            switch (option)
            {
            case FileReplaceOption.AlwaysOverwrite:
                res = (int)FileReplaceCode.IDM_REPLACE_ALL;
                break;

            case FileReplaceOption.AutoRenameFile:
                res = (int)FileReplaceCode.IDM_REPLACE_RENAME;
                break;

            case FileReplaceOption.NeverOverwrite:
                res = (int)FileReplaceCode.IDM_REPLACE_NONE;
                break;

            case FileReplaceOption.OverwriteFile:
                res = (int)FileReplaceCode.IDM_REPLACE_YES;
                break;

            case FileReplaceOption.SkipFile:
                res = (int)FileReplaceCode.IDM_REPLACE_NO;
                break;

            default:
                res = (int)FileReplaceCode.IDM_REPLACE_ALL;
                break;
            }

            return(res);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileReplaceEventArgs"/> class.
 /// </summary>
 /// <param name="message">The callback message received from Info-ZIP engine.</param>
 /// <param name="option">The file replace option.</param>
 public FileReplaceEventArgs(string message, FileReplaceOption option)
 {
     this.message = message;
     this.option  = option;
 }