Example #1
0
        private IntPtr SvnAuthSslClientCertPwPromptWrapper(out IntPtr cred,
                                                           IntPtr baton,
                                                           IntPtr realm, int may_save,
                                                           IntPtr pool)
        {
            cred = IntPtr.Zero;
            SvnError err = SvnError.NoError;

            SvnAuthProviderObject.SslClientCertPwPrompt func =
                mFunc as SvnAuthProviderObject.SslClientCertPwPrompt;
            try {
                SvnAuthCredSslClientCertPw credSslClientCertPw;
                Debug.Write(String.Format("[Callback:{0}]SslClientCertPwPromptProvider({1:X},{2},{3},{4})...", func.Method.Name, baton.ToInt32(), new AprString(realm), (may_save != 0), new AprPool(pool)));
                err = func(out credSslClientCertPw, baton,
                           new AprString(realm),
                           (may_save != 0), new AprPool(pool));
                Debug.WriteLine(String.Format("Done({0})", credSslClientCertPw));
                cred = credSslClientCertPw;
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }
Example #2
0
        //[CLSCompliant(false)]
        private IntPtr SvnAuthSslServerTrustPromptWrapper(out IntPtr cred, IntPtr baton,
                                                          IntPtr realm, uint failures,
                                                          IntPtr cert_info,
                                                          int may_save, IntPtr pool)
        {
            cred = IntPtr.Zero;
            SvnError err = SvnError.NoError;

            SvnAuthProviderObject.SslServerTrustPrompt func =
                mFunc as SvnAuthProviderObject.SslServerTrustPrompt;
            try {
                SvnAuthCredSslServerTrust credSslServerTrust;
                Debug.Write(String.Format("[Callback:{0}]SslServerTrustPromptProvider({1:X},{2},{3},{4},{5},{6})...", baton.ToInt32(), new AprString(realm), unchecked ((int)failures), new SvnAuthSslServerCertInfo(cert_info), (may_save != 0), new AprPool(pool)));
                err = func(out credSslServerTrust, baton,
                           new AprString(realm), (SvnAuthCredSslServerTrust.CertFailures)failures,
                           new SvnAuthSslServerCertInfo(cert_info),
                           (may_save != 0), new AprPool(pool));
                Debug.WriteLine(String.Format("Done({0})", credSslServerTrust));
                cred = credSslServerTrust;
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }
Example #3
0
        private IntPtr SvnClientGetCommitLogWrapper(out IntPtr log_message, out IntPtr tmp_file,
                                                    IntPtr commit_items, IntPtr baton,
                                                    IntPtr pool)
        {
            log_message = IntPtr.Zero;
            tmp_file    = IntPtr.Zero;
            SvnError err = SvnError.NoError;

            SvnClient.GetCommitLog func = mFunc as SvnClient.GetCommitLog;
            try {
                AprString logMessage;
                SvnPath   tmpFile;
                Debug.Write(String.Format("[Callback:{0}]SvnClientGetCommitLog({1},{2:X},{3})...", func.Method.Name, new AprArray(commit_items), baton.ToInt32(), new AprPool(pool)));
                err = func(out logMessage, out tmpFile,
                           new AprArray(commit_items, typeof(SvnClientCommitItem)), baton,
                           new AprPool(pool));
                Debug.WriteLine(String.Format("Done({0},{1})", logMessage, tmpFile));
                log_message = logMessage;
                tmp_file    = tmpFile;
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }
Example #4
0
        private IntPtr SvnStreamCloseWrapper(IntPtr baton)
        {
            SvnError err = SvnError.NoError;

            SvnStream.CloseFunc func = mFunc as SvnStream.CloseFunc;
            try {
                Debug.Write(String.Format("[Callback:{0}]SvnStreamCloseFunc({1:X})...", func.Method.Name, baton.ToInt32()));
                err = func(baton);
                Debug.WriteLine((err.IsNoError) ? "Return(NoError)" : String.Format("Return({0})", err.Message));
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }
Example #5
0
        private IntPtr SvnStreamWriteWrapper(IntPtr baton, IntPtr data, ref uint len)
        {
            SvnError err = SvnError.NoError;

            SvnStream.WriteFunc func = mFunc as SvnStream.WriteFunc;
            try {
                Debug.Write(String.Format("[Callback:{0}]SvnStreamWriteFunc({1:X},{2:X},{3})...", func.Method.Name, baton.ToInt32(), data.ToInt32(), len));
                int slen = unchecked ((int)len);
                err = func(baton, data, ref slen);
                len = unchecked ((uint)slen);
                Debug.WriteLine(String.Format("Done({0})", len));
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }
Example #6
0
        private IntPtr SvnClientBlameReceiverWrapper(IntPtr baton, long lineNo, int revision,
                                                     IntPtr author, IntPtr date, IntPtr line,
                                                     IntPtr pool)
        {
            SvnError err = SvnError.NoError;

            SvnClient.BlameReceiver func = mFunc as SvnClient.BlameReceiver;
            try {
                Debug.Write(String.Format("[Callback:{0}]SvnClientBlameReceiver({1:X},{2},{3},{4},{5},{6},{7})...", func.Method.Name, baton.ToInt32(), lineNo, revision, new AprString(author), new AprString(date), new AprString(line), new AprPool(pool)));
                err = func(baton, lineNo, revision,
                           new AprString(author), new AprString(date), new AprString(line),
                           new AprPool(pool));
                Debug.WriteLine((err.IsNoError) ? "Return(NoError)" : String.Format("Return({0})", err.Message));
            }
            catch (SvnException e) {
                err = SvnError.Create(e.AprErr, SvnError.NoError, e.Message);
            }
            catch (Exception e) {
                err = SvnError.Create(215000, SvnError.NoError, e.Message);
            }
            return(err);
        }