Ejemplo n.º 1
0
        public void RegisterParameters(ICommand command, IParameterRegisterer parameters) {
            parameters.Register("api_key", this.appId, command.Verb);

            //var paramsString =
            //  string.Join("", command.Parameters.OrderBy(p => p.Key).Select(p => p.Key + p.Value))
            //  + this.appSecret;

            //var sig = Md5.GetMd5String(paramsString);

            //parameters.Register("api_sig", sig, command.Verb);
        }
Ejemplo n.º 2
0
 public override void RegisterParameters(IParameterRegisterer registerer)
 {
     if (!string.IsNullOrEmpty(this.SubmittedUrl) && !string.IsNullOrEmpty(this.Comment))
     {
         registerer.RegisterPostContent(
             new {
             visibility = new { code = this.Visibility.GetString() },
             comment    = this.Comment,
             content    = new {
                 submittedUrl      = this.SubmittedUrl,
                 title             = this.Title,
                 description       = this.Description,
                 submittedImageUrl = this.SubmittedImageUrl,
             }
         });
     }
     else if (!string.IsNullOrEmpty(this.Comment))
     {
         registerer.RegisterPostContent(
             new {
             visibility = new { code = this.Visibility.GetString() },
             comment    = this.Comment,
         });
     }
     else if (!string.IsNullOrEmpty(this.SubmittedUrl))
     {
         registerer.RegisterPostContent(
             new {
             visibility = new { code = this.Visibility.GetString() },
             content    = new {
                 submittedUrl      = this.SubmittedUrl,
                 title             = this.Title,
                 description       = this.Description,
                 submittedImageUrl = this.SubmittedImageUrl,
             }
         });
     }
     else
     {
         throw new InvalidOperationException("Post must contain 'comment' and/or ('content/title' and 'content/submitted-url'). Max length is 700 characters. ");
     }
 }
Ejemplo n.º 3
0
        public override void RegisterParameters(IParameterRegisterer registerer)
        {
            registerer.RegisterGet("q", this.Query);

            if (this.Language.HasValue)
            {
                registerer.RegisterGet("lang", this.Language.Value.ToString().ToLower());
            }

            if (this.ResultType.HasValue)
            {
                registerer.RegisterGet("result_type", this.ResultType.Value.ToString().ToLower());
            }

            if (this.Count.HasValue)
            {
                registerer.RegisterGet("count", this.Count.Value.ToString(CultureInfo.InvariantCulture));
            }

            if (this.Until.HasValue)
            {
                registerer.RegisterGet("until", this.Until.Value.ToString("yyyy-MM-dd"));
            }

            if (!string.IsNullOrEmpty(this.SinceId))
            {
                registerer.RegisterGet("since_id", this.SinceId);
            }

            if (!string.IsNullOrEmpty(this.MaxId))
            {
                registerer.RegisterGet("max_id", this.MaxId);
            }

            registerer.RegisterGet("include_entities", this.IncludeEntities);
        }
 public abstract void RegisterParameters(IParameterRegisterer registerer);
 public void RegisterParameters(ICommand command, IParameterRegisterer parameters) {
     throw new System.NotImplementedException();
 }
 public override void RegisterParameters(IParameterRegisterer registerer)
 {
 }
 public override void RegisterParameters(IParameterRegisterer registerer)
 {
     registerer.RegisterPost("status", this.Status);
 }
 public override void RegisterParameters(IParameterRegisterer registerer)
 {
     registerer.RegisterGet("screen_name", this.ScreenName);
 }