Example #1
0
 /// <summary>
 /// Returns the string URL for a given type.
 /// </summary>
 /// <param name="type">The type for which we are retrieving the operation URL.</param>
 /// <returns>A URL that can be used with WWW to perform an operation, or null if no such URL is found.</returns>
 public static string GetURL(Type type)
 {
     if (_webOperationURLs == null)
     {
         _webOperationURLs = new WebOperationURLs();
     }
     return(_webOperationURLs.GetURLFromType(type));
 }
Example #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));
    }
Example #3
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);
    }
Example #4
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);
    }
Example #5
0
 public GetGroupsOperationResult Execute()
 {
     return(new GetGroupsOperationResult(WebOperation.Execute(new WebOperationCriteria(WebOperationURLs.GetURL(GetType()), GetFieldDictionaryFromCriteria(_getGroupsOperationCriteria)))));
 }
Example #6
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));
    }