コード例 #1
0
        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);
        }
コード例 #2
0
 void ICustomObjectSerialize.WritePropertyValues(SettingsStorage storage)
 {
     WritePropertyValuesCore(storage);
     WriteOption("AnonymousLogin", AnonymousLogin.ToString());
 }