private IntPtr SvnAuthSimplePromptWrapper(out IntPtr cred, IntPtr baton, IntPtr realm, IntPtr username, int may_save, IntPtr pool) { cred = IntPtr.Zero; SvnError err = SvnError.NoError; SvnAuthProviderObject.SimplePrompt func = mFunc as SvnAuthProviderObject.SimplePrompt; try { SvnAuthCredSimple credSimple; Debug.Write(String.Format("[Callback:{0}]SimplePromptProvider({1:X},{2},{3},{4},{5})...", func.Method.Name, baton.ToInt32(), new AprString(realm), new AprString(username), (may_save != 0), new AprPool(pool))); err = func(out credSimple, baton, new AprString(realm), new AprString(username), (may_save != 0), new AprPool(pool)); Debug.WriteLine(String.Format("Done({0})", credSimple)); cred = credSimple; } 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); }
public void AddPromptProvider(SvnAuthProviderObject.SimplePrompt promptFunc, IntPtr promptBaton, int retryLimit) { if (mAuthObjs == null) { mAuthObjs = new ArrayList(); } mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton, retryLimit, mGlobalPool)); }
// svn_auth_simple_prompt_func_t Wrapper public SvnDelegate(SvnAuthProviderObject.SimplePrompt func) { mFunc = func; mWrapperFunc = new Svn.svn_auth_simple_prompt_func_t(SvnAuthSimplePromptWrapper); }