private LoginBase CreateLogin() { LoginBase login = null; var uri = this._parameters.BoxUrl; var password = this._optionalParameters?.Password; var username = this._optionalParameters?.Username; if (username != null) { login = new UserBasedLogin(uri, username, password); } else if (password != null) { login = new PasswordBasedLogin(uri, password); } else { login = new AnonymousLogin(uri); } return(login); }
void ICustomObjectSerialize.WritePropertyValues(SettingsStorage storage) { WritePropertyValuesCore(storage); WriteOption("AnonymousLogin", AnonymousLogin.ToString()); }