void Utilities_CredentialsRequested(object sender, CredentialEventArgs e) { CredentialsRequested = true; UserCredentials = new Credentials() { UserName = "******", Password = "******", ServiceInformation = e.ServiceInfo }; Utilities.IfCanAcceptSet(UserCredentials); }
public void CredentialsProvided(Credentials credentials) { var serviceId = credentials.ServiceInformation.ServiceID; var userName = credentials.UserName; var normalizedUserName = GetNormalizedUserName(userName); var password = credentials.Password; if (!_cache.ContainsKey(serviceId)) _cache[serviceId] = new CachedCredential { ServiceId = serviceId, UserName = normalizedUserName, Password = password, IsPasswordCached = credentials.IsPasswordCachingAllowed }; SaveCache(); }
public string SendMessage(Credentials credentials, string message) { ProvidedCredentials = credentials; MessagesSent++; SentMessages.Add(message); return "result message"; }
public string GetMessages(Credentials credentials) { ProvidedCredentials = credentials; return "[{text:'test message'}]"; }
public string GetContacts(Credentials credentials) { throw new System.NotImplementedException(); }
public string GetMessages(Credentials credentials) { return "result message"; }
public void SetCredentials(Credentials credentials) { _Credentials = credentials; if(!String.IsNullOrEmpty(_Credentials.UserName) || _Credentials.Password != null) _DataAccess.Login(_Credentials.UserName, _Credentials.Password); }
public void IfCanAcceptSet(Credentials credentials) { if(_CanAccept(credentials)) SetCredentials(credentials); }
private static bool _CanAccept(Credentials credentials) { return credentials.ServiceInformation.ServiceID.Equals(_ServiceInformation.ServiceID); }
public void IfCanAcceptSet(Credentials credentials) { }
public bool CanAccept(Credentials credentials) { return true; }
public void CredentialsProvided(Credentials credentials) { }
public void CredentialsProvided(Credentials credentials) { _CredentialsProvidedObserver.CredentialsProvided(credentials); }
/// <summary> /// TODO: Need specs that cover the use of this method. /// </summary> /// <param name="credentials"></param> public void CredentialsProvided(Credentials credentials) { _MessagingServicesProvider.ForEachPlugIn(plugIn=>plugIn.IfCanAcceptSet(credentials)); }