Beispiel #1
0
    /// <summary>
    /// Executes the RegisterOperation asynchronously. The RegisterOperationCallback will be invoked when the operation has completed.
    /// </summary>
    /// <param name="registerOperationCallback">The RegisterOperationCallback to be invoked when the operation completes.</param>
    public void ExecuteAsync(RegisterOperationCallback registerOperationCallback)
    {
        Asserter.NotNull(registerOperationCallback, "RegisterOperation.ExecuteAsync:registerOperationCallback is null");
        WebOperationCallback webOperationCallback = (ResultSet results) =>
        {
            RegisterOperationResult result = CreateResultFromResultSet(results);
            registerOperationCallback(result);
        };

        WebOperation.ExecuteAsync(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), CreateFieldDictionaryFromCriteria(_criteria)), webOperationCallback);
    }
Beispiel #2
0
    /// <summary>
    /// Executes the LoginOperation.
    /// </summary>
    /// <returns>A LoginOperationResult containing the result of the operation.</returns>
    public LoginOperationResult Execute()
    {
        Dictionary <string, string> fields = new Dictionary <string, string>();

        fields.Add(kUSERNAME_FIELD, _criteria.Username);
        fields.Add(kPASSWORD_FIELD, _criteria.Password);

        ResultSet resultSet = WebOperation.Execute(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), fields));

        return(CreateResultFromResultSet(resultSet));
    }
Beispiel #3
0
    /// <summary>
    /// Executes the LoginOperation asynchronously. The LoginOperationCallback will be invoked when the results are ready.
    /// </summary>
    /// <param name="loginOperationCallback">The callback to be invoked when the result of the LoginOperation is ready.</param>
    public void ExecuteAsync(LoginOperationCallback loginOperationCallback)
    {
        Asserter.NotNull(loginOperationCallback, "LoginOperation.ExecuteAsync:loginOperationCallback is null");
        Dictionary <string, string> fields = new Dictionary <string, string>();

        fields.Add(kUSERNAME_FIELD, _criteria.Username);
        fields.Add(kPASSWORD_FIELD, _criteria.Password);

        WebOperationCallback webOperationCallback = (ResultSet resultSet) =>
        {
            LoginOperationResult result = CreateResultFromResultSet(resultSet);
            loginOperationCallback(result);
        };

        WebOperation.ExecuteAsync(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), fields), webOperationCallback);
    }
Beispiel #4
0
 public GetGroupsOperationResult Execute()
 {
     return(new GetGroupsOperationResult(WebOperation.Execute(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), GetFieldDictionaryFromCriteria(_getGroupsOperationCriteria)))));
 }
Beispiel #5
0
    /// <summary>
    /// Executes the RegisterOperation.
    /// </summary>
    /// <returns>A RegisterOperationResult containing the result of the operation.</returns>
    public RegisterOperationResult Execute()
    {
        ResultSet resultSet = WebOperation.Execute(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), CreateFieldDictionaryFromCriteria(_criteria)));

        return(CreateResultFromResultSet(resultSet));
    }