Пример #1
0
        public MP.XmlRpc.Struct ToStruct()
        {
            var struct_ = new MP.XmlRpc.Struct();

            struct_["description"] = new MP.XmlRpc.StringValue(this.Description);
            struct_["htmlUrl"]     = new MP.XmlRpc.StringValue(this.HtmlUrl);
            struct_["rssUrl"]      = new MP.XmlRpc.StringValue(this.RssUrl);
            return(struct_);
        }
Пример #2
0
        public MP.XmlRpc.Struct ToStruct()
        {
            var struct_ = new MP.XmlRpc.Struct();
            struct_["blogid"] = new MP.XmlRpc.StringValue(this.ID);
            struct_["url"] = new MP.XmlRpc.StringValue(this.Url);
            struct_["blogName"] = new MP.XmlRpc.StringValue(this.Name);

            return struct_;
        }
Пример #3
0
        public MP.XmlRpc.Struct ToStruct()
        {
            var struct_ = new MP.XmlRpc.Struct();

            struct_["blogid"]   = new MP.XmlRpc.StringValue(this.ID);
            struct_["url"]      = new MP.XmlRpc.StringValue(this.Url);
            struct_["blogName"] = new MP.XmlRpc.StringValue(this.Name);

            return(struct_);
        }
Пример #4
0
        public MetaWeblog.Portable.XmlRpc.Struct ToStruct()
        {
            var struct_ = new MetaWeblog.Portable.XmlRpc.Struct();

            if (this.DateCreated != null)
            {
                struct_["dateCreated"] = new MetaWeblog.Portable.XmlRpc.DateTimeValue(this.DateCreated.Value);
            }
            struct_["description"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Description);
            struct_["title"]       = new MetaWeblog.Portable.XmlRpc.StringValue(this.Title);
            //struct_["enclosure"] = ???
            struct_["link"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Link);
            //struct_["permalink"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Permalink);
            struct_["postid"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.PostId);
            //struct_["source"] = ??
            // struct_["wp_slug"] = first sentence ??
            // struct_["mt_basename"] = first sentence ??

            return(struct_);
        }
Пример #5
0
        private void handle_metaWeblog_newMediaObject(System.Net.HttpListenerContext context, MP.XmlRpc.MethodCall methodcall)
        {
            this.WriteLogMethodName();

            var blogid   = (MP.XmlRpc.StringValue)methodcall.Parameters[0];
            var username = (MP.XmlRpc.StringValue)methodcall.Parameters[1];
            var password = (MP.XmlRpc.StringValue)methodcall.Parameters[2];

            this.AuthenicateUser(username.String, password.String);

            this.WriteLog("BlogId = {0}", blogid.String);
            this.WriteLog("Username = {0}", username.String);

            var struct_ = (MP.XmlRpc.Struct)methodcall.Parameters[3];

            var name = struct_.Get <MP.XmlRpc.StringValue>("name");
            var type = struct_.Get <MP.XmlRpc.StringValue>("type");
            var bits = struct_.Get <MP.XmlRpc.Base64Data>("bits");

            this.WriteLog("Name = {0}", name.String);
            this.WriteLog("Type = {0}", type.String);
            this.WriteLog("Bits  = {0} Bytes Characters", bits.Bytes);

            var mo = this.MediaObjectList.StoreNewObject(blogid.String, username.String, name.String, type.String,
                                                         Convert.ToBase64String(bits.Bytes));

            var s_ = new MP.XmlRpc.Struct();

            s_["url"] = new MP.XmlRpc.StringValue(this.ServerUrlPrimary + mo.Url.Substring(1));

            var method_response = new MP.XmlRpc.MethodResponse();

            method_response.Parameters.Add(s_);

            string response_body = method_response.CreateDocument().ToString();

            this.WriteLog(response_body);
            WriteResponseString(context, response_body, 200, "text/xml");
        }
        private void handle_metaWeblog_newMediaObject(System.Net.HttpListenerContext context, MP.XmlRpc.MethodCall methodcall)
        {
            this.WriteLogMethodName();

            var blogid = (MP.XmlRpc.StringValue)methodcall.Parameters[0];
            var username = (MP.XmlRpc.StringValue)methodcall.Parameters[1];
            var password = (MP.XmlRpc.StringValue)methodcall.Parameters[2];

            this.AuthenicateUser(username.String, password.String);

            this.WriteLog("BlogId = {0}", blogid.String);
            this.WriteLog("Username = {0}", username.String);

            var struct_ = (MP.XmlRpc.Struct)methodcall.Parameters[3];

            var name = struct_.Get<MP.XmlRpc.StringValue>("name");
            var type = struct_.Get<MP.XmlRpc.StringValue>("type");
            var bits = struct_.Get<MP.XmlRpc.Base64Data>("bits");

            this.WriteLog("Name = {0}", name.String);
            this.WriteLog("Type = {0}", type.String);
            this.WriteLog("Bits  = {0} Bytes Characters", bits.Bytes);

            var mo = this.MediaObjectList.StoreNewObject(blogid.String, username.String, name.String, type.String,
                Convert.ToBase64String(bits.Bytes));

            var s_ = new MP.XmlRpc.Struct();
            s_["url"] = new MP.XmlRpc.StringValue(this.ServerUrlPrimary + mo.Url.Substring(1));

            var method_response = new MP.XmlRpc.MethodResponse();
            method_response.Parameters.Add(s_);

            string response_body = method_response.CreateDocument().ToString();

            this.WriteLog(response_body);
            WriteResponseString(context, response_body, 200, "text/xml");
        }
Пример #7
0
        public MetaWeblog.Portable.XmlRpc.Struct ToStruct()
        {
            var struct_ = new MetaWeblog.Portable.XmlRpc.Struct();
            if (this.DateCreated != null)
            {
                struct_["dateCreated"] = new MetaWeblog.Portable.XmlRpc.DateTimeValue(this.DateCreated.Value);                
            }
            struct_["description"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Description);
            struct_["title"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Title);
            //struct_["enclosure"] = ???
            struct_["link"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Link);
            //struct_["permalink"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.Permalink);
            struct_["postid"] = new MetaWeblog.Portable.XmlRpc.StringValue(this.PostId);
            //struct_["source"] = ??
            // struct_["wp_slug"] = first sentence ??
            // struct_["mt_basename"] = first sentence ??            

            return struct_;

        }