/// <summary>
        /// Creates respect for an tip. This corresponds to the
        /// tip.createRespect Hyves method.
        /// </summary>
        /// <param name="targetTipId">A single tipid.</param>
        /// <param name="respectType">The type of the respect.</param>
        /// <returns>True if the call succeeds, false if the call fails.</returns>
        public bool CreateRespect(string targetTipId, HyvesRespectType respectType)
        {
            if (string.IsNullOrEmpty(targetTipId))
            {
                throw new ArgumentException("targetTipId");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["target_tipid"] = targetTipId;
            request.Parameters["respecttype"]  = EnumHelper.GetDescription(respectType);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.TipsCreateRespect);

            return(response.Status == HyvesResponseStatus.Succeeded);
        }
Пример #2
0
        private HyvesRespectType TransformRespectType()
        {
            Debug.Assert(typeTransformed == false);

            HyvesRespectType respectType = HyvesRespectType.NotSpecified;
            string           state       = GetState <string>("respectType") ?? String.Empty;

            if (state.Length != 0)
            {
                if (state.Equals("withprofile"))
                {
                    respectType = HyvesRespectType.WithProfile;
                }
                else if (state.Equals("anonymous"))
                {
                    respectType = HyvesRespectType.Anonymous;
                }
            }

            this["respectType"] = respectType;
            typeTransformed     = true;

            return(respectType);
        }
    /// <summary>
    /// Creates respect for a user. This corresponds to the
    /// user.createRespect Hyves method.
    /// </summary>
    /// <param name="targetUserId">A single userid.</param>
    /// <param name="respectType">The type of the respect.</param>
    /// <returns>True if the call succeeds, false if the call fails.</returns>
    public bool CreateRespect(string targetUserId, HyvesRespectType respectType)
    {
      if (string.IsNullOrEmpty(targetUserId))
      {
        throw new ArgumentNullException("targetUserId");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["target_userid"] = targetUserId;
      request.Parameters["respecttype"] = EnumHelper.GetDescription(respectType);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersCreateRespect);
      return response.Status == HyvesResponseStatus.Succeeded;
    }