Пример #1
0
        private void Menu_DisplayWidgetOnClick(object sender, RoutedEventArgs e)
        {
            var testFolder = ConfigurationManager.AppSettings["WidgetTestFolder"];
            var fileName   = System.IO.Path.Combine(testFolder, TextBoxParameterName.Text + ".html");

            StoreWidgetDisplayFields();

            var service = new WidgetServiceClient();
            var html    = service.GetWidget(new Parameters {
                Widget = workWidget
            });

            using (var w = new StreamWriter(fileName))
            {
                w.Write(html);
                w.Flush();
            }

            ExampleBrowser.Navigate(string.Format("file:///{0}", fileName));
        }
Пример #2
0
        private void GetSource_Click(object sender, RoutedEventArgs e)
        {
            GetSource = true;
            ExampleBrowser.Navigate(new Uri(TextBoxUrl.Text));

            var testWidget = new WidgetServiceClient();

            //TextBoxLinks.Text = string.IsNullOrWhiteSpace(TextBoxTag.Text)
            //        ? workWidget.ScanForLinks(ExampleBrowser.Document.ToString())
            //        : workWidget.ScanForTags(ExampleBrowser.Document.ToString(), TextBoxTag.Text);

            //if (!string.IsNullOrWhiteSpace(workWidget.ErrorMessage))
            //{
            //    TextBoxErrorMessage.Text = workWidget.ErrorMessage;
            //    workWidget.ErrorMessage = string.Empty;
            //}
            //else
            //{
            //    TextBoxErrorMessage.Text = string.Empty;
            //}
        }