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)); }
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); } }
public static void SetContentPluginCallback(ContentProgressCallback contentProgress) { contentProgressCallback = contentProgress; }