Esempio n. 1
0
        private void HttpsCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                XDocument xdoc = XDocument.Parse(e.Result, LoadOptions.None);

                string nameSpace = xdoc.Root.Name.NamespaceName;

                XName projectName     = XName.Get("projectname", nameSpace);
                XName projectDcNumber = XName.Get("projectnumber", nameSpace);
                XName parameter       = XName.Get("parameter", nameSpace);
                XName rating          = XName.Get("rating", nameSpace);
                XName feedback        = XName.Get("feedback", nameSpace);
                XName group2          = XName.Get("group2", nameSpace);

                string projectNamestr  = xdoc.Descendants(projectName).First().Value;
                string projectDCNumber = xdoc.Descendants(projectDcNumber).First().Value;

                BPSFeedbackItem feedbackItem;
                foreach (XElement xelem in xdoc.Descendants(group2))
                {
                    feedbackItem                 = new BPSFeedbackItem();
                    feedbackItem.ProjectName     = projectNamestr;
                    feedbackItem.ProjectDCNumber = projectDCNumber;
                    feedbackItem.Feedback        = xelem.Descendants(feedback).First().Value;
                    feedbackItem.Parameter       = xelem.Descendants(parameter).First().Value;
                    feedbackItem.Rating          = xelem.Descendants(rating).First().Value;

                    feedbacks.Add(feedbackItem);
                }

                data = new PagedCollectionView(feedbacks);

                Dispatcher.BeginInvoke(delegate()
                {
                    MainGrid.ItemsSource = data;
                });
            }
        }
Esempio n. 2
0
        private void HttpsCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                XDocument xdoc = XDocument.Parse(e.Result, LoadOptions.None);

                string nameSpace = xdoc.Root.Name.NamespaceName;

                XName projectName = XName.Get("projectname", nameSpace);
                XName projectDcNumber = XName.Get("projectnumber", nameSpace);
                XName parameter = XName.Get("parameter", nameSpace);
                XName rating = XName.Get("rating", nameSpace);
                XName feedback = XName.Get("feedback", nameSpace);
                XName group2 = XName.Get("group2", nameSpace);

                string projectNamestr = xdoc.Descendants(projectName).First().Value;
                string projectDCNumber = xdoc.Descendants(projectDcNumber).First().Value;

                BPSFeedbackItem feedbackItem;
                foreach (XElement xelem in xdoc.Descendants(group2))
                {
                    feedbackItem = new BPSFeedbackItem();
                    feedbackItem.ProjectName = projectNamestr;
                    feedbackItem.ProjectDCNumber = projectDCNumber;
                    feedbackItem.Feedback = xelem.Descendants(feedback).First().Value;
                    feedbackItem.Parameter = xelem.Descendants(parameter).First().Value;
                    feedbackItem.Rating = xelem.Descendants(rating).First().Value;

                    feedbacks.Add(feedbackItem);

                }

                data = new PagedCollectionView(feedbacks);

                Dispatcher.BeginInvoke(delegate()
                {
                    MainGrid.ItemsSource = data;

                });
            }
        }