예제 #1
0
 public static int CompareFiles(ContentProgressCallback progressCallback, int compareIndex,
                                [MarshalAs(UnmanagedType.LPStr)] string fileName1,
                                [MarshalAs(UnmanagedType.LPStr)] string fileName2,
                                ref ContentFileDetails contentFileDetails)
 {
     return(CompareFilesW(progressCallback, compareIndex, fileName1, fileName2, ref contentFileDetails));
 }
예제 #2
0
        public static int CompareFilesW(ContentProgressCallback progressCallback, int compareIndex,
                                        [MarshalAs(UnmanagedType.LPWStr)] string fileName1,
                                        [MarshalAs(UnmanagedType.LPWStr)] string fileName2,
                                        ref ContentFileDetails contentFileDetails)
        {
            _callSignature = $"ContentCompareFiles '{fileName1}' => '{fileName2}' ({compareIndex})";
            TcCallback.SetContentPluginCallback(progressCallback);
            try {
                var result = Plugin.CompareFiles(compareIndex, fileName1, fileName2, contentFileDetails, out var iconResourceId);

                TraceCall(TraceLevel.Info, result.ToString());

                if (result == ContentCompareResult.EqualWithIcon && iconResourceId >= 100)
                {
                    return(iconResourceId);
                }
                else
                {
                    return((int)result);
                }
            }
            catch (Exception ex) {
                ProcessException(ex);
                return((int)ContentCompareResult.FileOpenError);
            }
            finally {
                TcCallback.SetContentPluginCallback(null);
            }
        }
예제 #3
0
 public static void SetContentPluginCallback(ContentProgressCallback contentProgress)
 {
     contentProgressCallback = contentProgress;
 }