상속: System.ComponentModel.Component, IXmlRpcProxy
예제 #1
0
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol ClientProtocol,
     XmlRpcRequest XmlRpcReq,
     Encoding XmlEncoding,
     bool useEmptyParamsTag,
     bool useIndentation,
     int indentation,
     bool UseIntTag,
     bool UseStringTag,
     WebRequest Request,
     AsyncCallback UserCallback,
     object UserAsyncState,
     int retryNumber)
 {
     xmlRpcRequest          = XmlRpcReq;
     clientProtocol         = ClientProtocol;
     request                = Request;
     userAsyncState         = UserAsyncState;
     userCallback           = UserCallback;
     completedSynchronously = true;
     xmlEncoding            = XmlEncoding;
     _useEmptyParamsTag     = useEmptyParamsTag;
     _useIndentation        = useIndentation;
     _indentation           = indentation;
     _useIntTag             = UseIntTag;
     _useStringTag          = UseStringTag;
 }
예제 #2
0
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol clientProtocol,
     XmlRpcRequest xmlRpcReq,
     Encoding xmlEncoding,
     bool useEmptyParamsTag,
     bool useIndentation,
     int indentation,
     bool useIntTag,
     bool useStringTag,
     WebRequest request,
     AsyncCallback userCallback,
     object userAsyncState)
 {
     XmlRpcRequest           = xmlRpcReq;
     ClientProtocol          = clientProtocol;
     Request                 = request;
     AsyncState              = userAsyncState;
     _userCallback           = userCallback;
     _completedSynchronously = true;
     XmlEncoding             = xmlEncoding;
     UseEmptyParamsTag       = useEmptyParamsTag;
     UseIndentation          = useIndentation;
     Indentation             = indentation;
     UseIntTag               = useIntTag;
     UseStringTag            = useStringTag;
 }
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol ClientProtocol,
     XmlRpcRequest XmlRpcReq,
     Encoding XmlEncoding,
     bool useEmptyParamsTag,
     bool useIndentation,
     int indentation,
     bool UseIntTag,
     bool UseStringTag,
     WebRequest Request,
     AsyncCallback UserCallback,
     object UserAsyncState,
     int retryNumber)
 {
     xmlRpcRequest = XmlRpcReq;
       clientProtocol = ClientProtocol;
       request = Request;
       userAsyncState = UserAsyncState;
       userCallback = UserCallback;
       _completedSynchronously = true;
       xmlEncoding = XmlEncoding;
       _useEmptyParamsTag = useEmptyParamsTag;
       _useIndentation = useIndentation;
       _indentation = indentation;
       this.UseIntTag = UseIntTag;
       this.UseStringTag = UseStringTag;
 }
예제 #4
0
        public void Method1()
        {
            ITest proxy             = (ITest)XmlRpcProxyGen.Create(typeof(ITest));
            XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy;

            Assert.IsTrue(cp is ITest);
            Assert.IsTrue(cp is XmlRpcClientProtocol);
        }
예제 #5
0
        public void Method1Generic()
        {
            ITest2 proxy            = XmlRpcProxyGen.Create <ITest2>();
            XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy;

            Assert.IsTrue(cp is ITest2);
            Assert.IsTrue(cp is IXmlRpcProxy);
            Assert.IsTrue(cp is XmlRpcClientProtocol);
        }
예제 #6
0
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol ClientProtocol,
     XmlRpcRequest XmlRpcReq,
     XmlRpcFormatSettings xmlRpcFormatSettings,
     WebRequest Request,
     AsyncCallback UserCallback,
     object UserAsyncState)
 {
     XmlRpcRequest           = XmlRpcReq;
     _clientProtocol         = ClientProtocol;
     _request                = Request;
     _userAsyncState         = UserAsyncState;
     _userCallback           = UserCallback;
     _completedSynchronously = true;
     XmlRpcFormatSettings    = xmlRpcFormatSettings;
 }
예제 #7
0
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol ClientProtocol, 
     XmlRpcRequest XmlRpcReq, 
     XmlRpcFormatSettings xmlRpcFormatSettings,
     WebRequest Request, 
     AsyncCallback UserCallback, 
     object UserAsyncState)
 {
     XmlRpcRequest = XmlRpcReq;
     _clientProtocol = ClientProtocol;
     _request = Request;
     _userAsyncState = UserAsyncState;
     _userCallback = UserCallback;
     _completedSynchronously = true;
     XmlRpcFormatSettings = xmlRpcFormatSettings;
 }
예제 #8
0
 //internal members
 internal XmlRpcAsyncResult(
     XmlRpcClientProtocol ClientProtocol,
     XmlRpcRequest XmlRpcReq,
     XmlRpcFormatSettings xmlRpcFormatSettings,
     WebRequest Request,
     AsyncCallback UserCallback,
     object UserAsyncState,
     int retryNumber)
 {
     xmlRpcRequest          = XmlRpcReq;
     clientProtocol         = ClientProtocol;
     request                = Request;
     userAsyncState         = UserAsyncState;
     userCallback           = UserCallback;
     completedSynchronously = true;
     XmlRpcFormatSettings   = xmlRpcFormatSettings;
 }
예제 #9
0
   //internal members
   internal XmlRpcAsyncResult(
 XmlRpcClientProtocol ClientProtocol, 
 XmlRpcRequest XmlRpcReq, 
 XmlRpcFormatSettings xmlRpcFormatSettings,
 WebRequest Request, 
 AsyncCallback UserCallback, 
 object UserAsyncState, 
 int retryNumber)
   {
       xmlRpcRequest = XmlRpcReq;
         clientProtocol = ClientProtocol;
         request = Request;
         userAsyncState = UserAsyncState;
         userCallback = UserCallback;
         completedSynchronously = true;
         XmlRpcFormatSettings = xmlRpcFormatSettings;
   }
예제 #10
0
 public void Detach(XmlRpcClientProtocol proxy)
 {
   proxy.RequestEvent -= new XmlRpcRequestEventHandler(OnRequest);
   proxy.ResponseEvent -= new XmlRpcResponseEventHandler(OnResponse);
 }
예제 #11
0
        private void btnImg_Click(object sender, EventArgs e)
        {
            var fi = new FileInfo("C:\\Program Files\\Utilities\\exiftool.exe");
            var exifTool = new ExifToolWrapper(fi);

            // Build our list of desired tags
            var tagList = new List<string>();
            tagList.AddRange(new String[]
            {
                "Title",
                "Description",
                "DateTimeOriginal"
            });

            FileInfo imageFi = new FileInfo(lblImage.Text);
            var tagValues = exifTool.GetTagsFromFile(imageFi, tagList);

            var newMediaPost = default(newMediaDescriptor);
            newMediaPost.name = "ProgramaticallyUploadedImage.jpg";
            newMediaPost.type = "image/jpeg";
            newMediaPost.overwrite = false;

            // Now we read in the picture and turn it into a byte array
            byte[] fileAsBytes;

            using (var fs = new FileStream(lblImage.Text, FileMode.Open))
            {
                fileAsBytes = new byte[fs.Length];
                fs.Read(fileAsBytes, 0, (int)fs.Length);
            }

            // And convert it to base-64 encoding
            newMediaPost.bits = Convert.ToBase64String(fileAsBytes);

            categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
            clientProtocol = (XmlRpcClientProtocol)categories;
            clientProtocol.Url = "http://www.thepotters.org/test/wpl/xmlrpc.php";

            try
            {
                var result = categories.NewMedia(
                    3, "test", "DjF3iUfMDto0", newMediaPost);

                MessageBox.Show(string.Format(
                    "ID: {0}\r\nFile: {1}\r\nURL: {2}\r\nType:{3}",
                    result.id,
                    result.file,
                    result.url,
                    result.type));

                tbBody.Text = "";
                tbTitle.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #12
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            // Username:    test
            // Password:    DjF3iUfMDto0
            blogInfo newBlogPost = default(blogInfo);
            newBlogPost.title = tbTitle.Text;
            newBlogPost.description = tbBody.Text;
            newBlogPost.dateCreated = new DateTime(2009,10,11);

            categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
            clientProtocol = (XmlRpcClientProtocol)categories;
            clientProtocol.Url = "http://www.thepotters.org/test/wpl/xmlrpc.php";
            string result = null;
            result = "";
            try
            {
                result = categories.NewPost(1, "test", "DjF3iUfMDto0", newBlogPost, 1);
                MessageBox.Show("Posted to Blog successfullly! Post ID : " + result);
                tbBody.Text = "";
                tbTitle.Text = "";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #13
0
 public void Method1()
 {
     var proxy = (ITest)XmlRpcProxyGen.Create(typeof(ITest));
     XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy;
 }
예제 #14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="proxy"></param>
 public void Detach(XmlRpcClientProtocol proxy)
 {
     proxy.RequestEvent  -= new XmlRpcRequestEventHandler(OnRequest);
     proxy.ResponseEvent -= new XmlRpcResponseEventHandler(OnResponse);
 }