/// <summary> /// Unified handler trigger used by other "On[Event]" functions /// </summary> /// <param name="e"></param> /// <param name="DelegateType"></param> private static void _runDelegateByType(AuthEventArgs e, object DelegateType) { AuthEventHandler eventDelegate = (AuthEventHandler)listEventDelegates[DelegateType]; if (eventDelegate == null) { return; } eventDelegate(e); }
public Connect(AuthEventMethods eventMethods = null) { logg = LogHelper.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().ReflectedType); _event = new AuthEventHandler(); if (eventMethods == null) { logg.Debug("События не переопределены"); logg.Debug("Загрузка стандарных событий"); eventMethods = new AuthEventMethods(); } logg.Info("Регистрация слушателей"); _event.IssetLogin += eventMethods.OnIssetLogin; _event.IssetCaptcha += eventMethods.OnIssetCaptcha; _event.IseetCode += eventMethods.OnIssetCode; }
//--------------------------------------------------- public void DoLogIn(AuthEventHandler callback = null) { cbAuthEvent = callback; VKApi.Init(); }