Пример #1
0
        private IntPtr SvnAuthUsernamePromptWrapper(out IntPtr cred, IntPtr baton,
                                                    IntPtr realm, int may_save,
                                                    IntPtr pool)
        {
            cred = IntPtr.Zero;
            SvnError err = SvnError.NoError;

            SvnAuthProviderObject.UsernamePrompt func =
                mFunc as SvnAuthProviderObject.UsernamePrompt;
            try {
                SvnAuthCredUsername credUsername;
                Debug.Write(String.Format("[Callback:{0}]UsernamePromptProvider({1:X},{2},{3},{4})...", func.Method.Name, baton.ToInt32(), new AprString(realm), (may_save != 0), new AprPool(pool)));
                err = func(out credUsername, baton,
                           new AprString(realm),
                           (may_save != 0), new AprPool(pool));
                Debug.WriteLine(String.Format("Done({0})", credUsername));
                cred = credUsername;
            }
            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);
        }
Пример #2
0
 public void AddPromptProvider(SvnAuthProviderObject.UsernamePrompt promptFunc,
                               IntPtr promptBaton, int retryLimit)
 {
     if (mAuthObjs == null)
     {
         mAuthObjs = new ArrayList();
     }
     mAuthObjs.Add(SvnAuthProviderObject.GetPromptProvider(promptFunc, promptBaton,
                                                           retryLimit, mGlobalPool));
 }
Пример #3
0
 // svn_auth_username_prompt_func_t Wrapper
 public SvnDelegate(SvnAuthProviderObject.UsernamePrompt func)
 {
     mFunc        = func;
     mWrapperFunc = new Svn.svn_auth_username_prompt_func_t(SvnAuthUsernamePromptWrapper);
 }