//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; }
//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; }
public void Method1() { ITest proxy = (ITest)XmlRpcProxyGen.Create(typeof(ITest)); XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy; Assert.IsTrue(cp is ITest); Assert.IsTrue(cp is XmlRpcClientProtocol); }
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); }
//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; }
//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; }
public void Detach(XmlRpcClientProtocol proxy) { proxy.RequestEvent -= new XmlRpcRequestEventHandler(OnRequest); proxy.ResponseEvent -= new XmlRpcResponseEventHandler(OnResponse); }
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); } }
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); } }
public void Method1() { var proxy = (ITest)XmlRpcProxyGen.Create(typeof(ITest)); XmlRpcClientProtocol cp = (XmlRpcClientProtocol)proxy; }
/// <summary> /// /// </summary> /// <param name="proxy"></param> public void Detach(XmlRpcClientProtocol proxy) { proxy.RequestEvent -= new XmlRpcRequestEventHandler(OnRequest); proxy.ResponseEvent -= new XmlRpcResponseEventHandler(OnResponse); }