LibGit2Sharp.RemoteCallbacks.GitProgressHandler C# (CSharp) 메소드

GitProgressHandler() 개인적인 메소드

Handler for libgit2 Progress callback. Converts values received from libgit2 callback to more suitable types and calls delegate provided by LibGit2Sharp consumer.
private GitProgressHandler ( IntPtr str, int len, IntPtr data ) : int
str System.IntPtr IntPtr to string from libgit2
len int length of string
data System.IntPtr IntPtr to optional payload passed back to the callback.
리턴 int
        private int GitProgressHandler(IntPtr str, int len, IntPtr data)
        {
            ProgressHandler onProgress = Progress;

            bool shouldContinue = true;

            if (onProgress != null)
            {
                string message = LaxUtf8Marshaler.FromNative(str, len);
                shouldContinue = onProgress(message);
            }

            return Proxy.ConvertResultToCancelFlag(shouldContinue);
        }