コード例 #1
0
        private void Search()
        {
            List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();

            this.Dispatcher.Invoke(() => {
                contactsList.Children.Clear();
                parameters.Add(new KeyValuePair <string, string>("Page", 0 + ""));
            });

            string result = Request.Request.RequestData("/ContactForm/get", parameters);

            JArray arrays = Utils.Utils.StringToJsonArray(result);

            for (int i = 0; i < arrays.Count; i++)
            {
                ContactForm cf = ContactForm.JsonToContactForm((JObject)arrays[i]);

                parameters = new List <KeyValuePair <string, string> >();

                this.Dispatcher.Invoke(() => {
                    parameters.Add(new KeyValuePair <string, string>("Mail", cf.User_Mail));
                });

                result = Request.Request.RequestData("/User/getUser", parameters);

                User user = User.JsonToUser(Utils.Utils.StringToJsonObject(result));

                this.Dispatcher.Invoke(() => {
                    ContactFormButton cfb = new ContactFormButton(cf, this, user);
                    contactsList.Children.Add(cfb);
                });
            }
        }