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 override ContentCompareResult CompareFiles(int compareIndex, string fileName1, string fileName2, ContentFileDetails fileDetails, out int iconResourceId) { iconResourceId = -1; // You can call ContentProgressProc(int) here to inform TC about comparing progress. return(ContentCompareResult.CannotCompare); }
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 virtual ContentCompareResult CompareFiles(int compareIndex, string fileName1, string fileName2, ContentFileDetails contentFileDetails, out int iconResourceId) { iconResourceId = 0; return(ContentCompareResult.CannotCompare); }