private string ConvertResponsefieldsToString(HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields)
    {
      StringBuilder responsefieldsBuilder = new StringBuilder();
      if (responsefields == HyvesUserResponsefield.All)
      {
        responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString<HyvesUserResponsefield>());
      }
      else
      {
        var userResponsefields = Enum.GetValues(typeof(HyvesUserResponsefield));
        foreach (HyvesUserResponsefield userResponseField in userResponsefields)
        {
          if (EnumHelper.HasFlag(responsefields, userResponseField))
          {
            responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(userResponseField)));
          }
        }
      }

      if (privateResponseFields == HyvesUserPrivateResponsefield.All)
      {
        responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString<HyvesUserPrivateResponsefield>());
      }
      else if (privateResponseFields != HyvesUserPrivateResponsefield.None)
      {
        var userPrivateResponsefields = Enum.GetValues(typeof(HyvesUserPrivateResponsefield));
        foreach (HyvesUserPrivateResponsefield userPrivateResponseField in userPrivateResponsefields)
        {
          if (EnumHelper.HasFlag(privateResponseFields, userPrivateResponseField))
          {
            responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(privateResponseFields)));
          }
        }
      }

      responsefieldsBuilder = responsefieldsBuilder.Replace(
        string.Format("{0},", EnumHelper.GetDescription(HyvesUserResponsefield.All)), string.Empty);
      responsefieldsBuilder = responsefieldsBuilder.Replace(
        string.Format("{0},", EnumHelper.GetDescription(HyvesUserPrivateResponsefield.All)), string.Empty);
      string returnValue = responsefieldsBuilder.ToString();
      return returnValue.Substring(0, returnValue.Length - 1);
    }
        /// <summary>
        /// Gets the desired information about the specified users. This corresponds to the
        /// users.get Hyves method.
        /// </summary>
        /// <param name="userIds">The list of requested user Ids.</param>
        /// <param name="responsefields">Get extra information from the requested user.</param>
        /// <param name="responsefields">Get extra (private) information from the requested user.</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the specified users; null if the call fails.</returns>
        public Collection <User> GetUsers(Collection <string> userIds, HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields, bool useFancyLayout)
        {
            if ((userIds == null) || (userIds.Count == 0))
            {
                throw new ArgumentNullException("userIds");
            }

            StringBuilder userIdBuilder = new StringBuilder();

            if (userIds != null)
            {
                foreach (string id in userIds)
                {
                    if (userIdBuilder.Length != 0)
                    {
                        userIdBuilder.Append(",");
                    }
                    userIdBuilder.Append(id);
                }
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["userid"]            = userIdBuilder.ToString();
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, privateResponseFields);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGet, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <User>("user"));
            }

            return(null);
        }
    /// <summary>
    /// Gets the desired information about the specified users. This corresponds to the
    /// users.get Hyves method.
    /// </summary>
    /// <param name="userIds">The list of requested user Ids.</param>
    /// <param name="responsefields">Get extra information from the requested user.</param>
    /// <param name="responsefields">Get extra (private) information from the requested user.</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the specified users; null if the call fails.</returns>
    public Collection<User> GetUsers(Collection<string> userIds, HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields, bool useFancyLayout)
    {
      if ((userIds == null) || (userIds.Count == 0))
      {
        throw new ArgumentNullException("userIds");
      }

      StringBuilder userIdBuilder = new StringBuilder();
      if (userIds != null)
      {
        foreach (string id in userIds)
        {
          if (userIdBuilder.Length != 0)
          {
            userIdBuilder.Append(",");
          }
          userIdBuilder.Append(id);
        }
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["userid"] = userIdBuilder.ToString();
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, privateResponseFields);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGet, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<User>("user");
      }

      return null;
    }
        private string ConvertResponsefieldsToString(HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields)
        {
            StringBuilder responsefieldsBuilder = new StringBuilder();

            if (responsefields == HyvesUserResponsefield.All)
            {
                responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString <HyvesUserResponsefield>());
            }
            else
            {
                var userResponsefields = Enum.GetValues(typeof(HyvesUserResponsefield));
                foreach (HyvesUserResponsefield userResponseField in userResponsefields)
                {
                    if (EnumHelper.HasFlag(responsefields, userResponseField))
                    {
                        responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(userResponseField)));
                    }
                }
            }

            if (privateResponseFields == HyvesUserPrivateResponsefield.All)
            {
                responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString <HyvesUserPrivateResponsefield>());
            }
            else if (privateResponseFields != HyvesUserPrivateResponsefield.None)
            {
                var userPrivateResponsefields = Enum.GetValues(typeof(HyvesUserPrivateResponsefield));
                foreach (HyvesUserPrivateResponsefield userPrivateResponseField in userPrivateResponsefields)
                {
                    if (EnumHelper.HasFlag(privateResponseFields, userPrivateResponseField))
                    {
                        responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(privateResponseFields)));
                    }
                }
            }

            responsefieldsBuilder = responsefieldsBuilder.Replace(
                string.Format("{0},", EnumHelper.GetDescription(HyvesUserResponsefield.All)), string.Empty);
            responsefieldsBuilder = responsefieldsBuilder.Replace(
                string.Format("{0},", EnumHelper.GetDescription(HyvesUserPrivateResponsefield.All)), string.Empty);
            string returnValue = responsefieldsBuilder.ToString();

            return(returnValue.Substring(0, returnValue.Length - 1));
        }