Пример #1
0
        private void ButtonNewClick(object sender, RoutedEventArgs e)
        {
            var newAttrName = "NewAttribute";

            var i = 1;

            while (_content.Attribute(newAttrName) != null)
            {
                newAttrName = "NewAttribute" + i.ToString(Constants.DATE_TIME_FORMAT).Trim();
                i++;
            }
            var iDlg = new InfoDialog {
                InfoContent = newAttrName
            };

            iDlg.ShowDialog();
            if (iDlg.DialogResult == true)
            {
                newAttrName = iDlg.InfoContent;
                var newAttribute = new XAttribute(newAttrName,
                                                  "NewValue" + i.ToString(CultureInfo.InvariantCulture).Trim());
                try
                {
                    _content.Add(newAttribute);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                //ContentGrid.Rows += 1;
                AddPairControls(newAttribute);
            }
        }
Пример #2
0
        private void GetUIObjectsSaveToFile(object sender, RoutedEventArgs e)
        {
            if (!_autoClient.Browser.IsExisted())
            {
                var urlDialog = new InfoDialog {
                    Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL")
                };
                urlDialog.ShowDialog();
                if (urlDialog.DialogResult != true)
                {
                    return;
                }
                _config.Set("DefaultURL", urlDialog.InfoContent);
                _autoClient.Browser = new Browser(_config);
            }
            var uiObjectsString = _autoClient.Browser.GetAllValuableObjects();
            var fileDialog      = new SaveFileDialog
            {
                FileName   = "UI",
                DefaultExt = "xml",
                Filter     = "XML format (*.xml)|*.xml"
            };

            if (!fileDialog.ShowDialog().Value)
            {
                return;
            }
            var fileName = fileDialog.FileName;

            File.WriteAllText(fileName, uiObjectsString);
        }
 private  void StartBrowser(object sender, RoutedEventArgs e)
 {
     var urlDialog = new InfoDialog { Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL") };
     
     urlDialog.ShowDialog();
     if (urlDialog.DialogResult != true) return;
     _config.Set("DefaultURL",urlDialog.InfoContent);
     _autoClient.Browser = new Browser(_config);
      Task.Factory.StartNew(() => _autoClient.Browser.StartBrowser());
 }
Пример #4
0
        private void StartBrowser(object sender, RoutedEventArgs e)
        {
            var urlDialog = new InfoDialog {
                Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL")
            };

            urlDialog.ShowDialog();
            if (urlDialog.DialogResult != true)
            {
                return;
            }
            _config.Set("DefaultURL", urlDialog.InfoContent);
            _autoClient.Browser = new Browser(_config);
            Task.Factory.StartNew(() => _autoClient.Browser.StartBrowser());
        }
Пример #5
0
        private async Task RunTestLocally(string workflowId)
        {
            /**********This is a simple instance***********/
            var urlDialog = new InfoDialog {
                Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL")
            };

            urlDialog.ShowDialog();
            if (urlDialog.DialogResult != true)
            {
                return;
            }
            _config.Set("DefaultURL", urlDialog.InfoContent);
            _autoClient.Browser = new Browser(_config);
            _autoClient.Config.Set("HostType", "Local");
            await Task.Factory.StartNew((() => RunWorkflowById(workflowId)));

            /***********end of instance*******************/
        }
 private void GetUIObjectsSaveToFile(object sender, RoutedEventArgs e)
 {
     if (!_autoClient.Browser.IsExisted())
     {
         var urlDialog = new InfoDialog { Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL") };
         urlDialog.ShowDialog();
         if (urlDialog.DialogResult != true) return;
         _config.Set("DefaultURL", urlDialog.InfoContent);
         _autoClient.Browser = new Browser(_config);
     }
     var uiObjectsString = _autoClient.Browser.GetAllValuableObjects();
     var fileDialog = new SaveFileDialog
     {
         FileName = "UI",
         DefaultExt = "xml",
         Filter = "XML format (*.xml)|*.xml"
     };
     if (!fileDialog.ShowDialog().Value) return;
     var fileName = fileDialog.FileName;
     File.WriteAllText(fileName, uiObjectsString);
 }
 private async Task RunTestLocally(string workflowId)
 {
     /**********This is a simple instance***********/
     var urlDialog = new InfoDialog { Title = "Set the URL for Browser", InfoContent = _config.Get("DefaultURL") };
     urlDialog.ShowDialog();
     if (urlDialog.DialogResult != true) return;
     _config.Set("DefaultURL", urlDialog.InfoContent);
     _autoClient.Browser = new Browser(_config);
     _autoClient.Config.Set("HostType", "Local");
     await Task.Factory.StartNew(( () => RunWorkflowById(workflowId)));
     /***********end of instance*******************/
 }
Пример #8
0
        private void ButtonNewClick(object sender, RoutedEventArgs e)
        {
            var newAttrName = "NewAttribute";

            var i = 1;
            while (_content.Attribute(newAttrName) != null)
            {
                newAttrName = "NewAttribute" + i.ToString(Constants.DATE_TIME_FORMAT).Trim();
                i++;
            }
            var iDlg = new InfoDialog {InfoContent = newAttrName};
            iDlg.ShowDialog();
            if (iDlg.DialogResult == true)
            {
                newAttrName = iDlg.InfoContent;
                var newAttribute = new XAttribute(newAttrName,
                    "NewValue" + i.ToString(CultureInfo.InvariantCulture).Trim());
                try
                {
                    _content.Add(newAttribute);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                //ContentGrid.Rows += 1;
                AddPairControls(newAttribute);
            }
        }