public void StartAsyncLoadGet(String url, String tag)
        {
            httpClient = LuaEngine.Instance.GetHttpClient(this.tag, url);
            PostSubmitter ps = new PostSubmitter(httpClient, onComplete, onFail);

            ps.Submit(contentType);
        }
        public void StartAsyncLoad(String url, String data, String tag)
        {
            String[] arr = data.Split('#');
            Dictionary <String, Object> dict = new Dictionary <String, Object>();

            bool useFor = true;

            foreach (String s in arr)
            {
                String[] arrIn = s.Split('=');
                if (arrIn.Length > 1)
                {
                    dict.Add(arrIn[0], arrIn[1]);
                }
                else
                {
                    useFor = false;
                    break;
                }
            }
            if (!useFor)
            {
                dict.Add(data, null);
            }

            httpClient = LuaEngine.Instance.GetHttpClient(this.tag, url);
            PostSubmitter ps = new PostSubmitter(httpClient, onComplete, onFail);

            ps.parameters = dict;
            ps.Submit(contentType);
        }
示例#3
0
        public void UploadPhotoToServer(string server, byte[] photo, CallBack onSuccess, CallBack onError)
        {
            var postData = new Dictionary <string, object>()
            {
                { "access_token", this.access_token },
                { "photo", photo },
            };
            var postToServer = new PostSubmitter {
                url = server, parameters = postData
            };

            postToServer.PostResponseEvent += (sender, args) => this.SaveMessagesPhoto(
                args.Server,
                args.Photo,
                args.Hash,
                result =>
            {
                onSuccess((result as List <string>)[0]);
            },
                result =>
            {
                int i = 9;
            });
            postToServer.Submit();
        }
        public void StartAsyncLoadForm(String url, Object formData, String tag)
        {
            LuaObjectStore los = (LuaObjectStore)formData;
            Dictionary <String, Object> partList = (Dictionary <String, Object>)los.obj;

            httpClient = LuaEngine.Instance.GetHttpClient(this.tag, url);
            PostSubmitter ps = new PostSubmitter(httpClient, onComplete, onFail);

            ps.Submit(contentType);
        }
        //private methods
        private void OnOkClick(object sender, EventArgs e)
        {
            WebClient wc = new WebClient();

            var picture = App.Settings.PhotoByUser;
            Dictionary <string, object> data = new Dictionary <string, object>()
            {
                { "user_file[]", picture.ToArray() }
            };
            PostSubmitter post = new PostSubmitter()
            {
                url = "http://www.ajapaik.ee/foto/" + App.Settings.SelectedPhoto.ID + "/upload/", parameters = data
            };

            post.theEvent += new EventHandler(post_theEvent);
            post.Submit();
        }
示例#6
0
 private void actualizarPhoto()
 {
     if (TomoFoto == true)
     {
         this.Focus();
         Dictionary<string, object> data = new Dictionary<string, object>()
             {
                 {"UserProfileID",uid},
                 {"UserProfilePhoto",byteArray},
             };
         PostSubmitter post = new PostSubmitter() { url = "http://www.partyonapp.com/API/updatephotoprofile/", parameters = data };
         post.Submit();
     }
     else
     {
         MessageBox.Show("You should take a picture.", "PartyOn", MessageBoxButton.OK);
     }
 }