Example #1
0
        /// <summary>
        /// Click event handler for saving the new config file. Validates prior to saving.  Displays the error/save message box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveFile_Click(object sender, EventArgs e)
        {
            try
            {
                var formProcessor = new FormProcessor(ContentFlow);

                var cv = new ConfigValidator(ConfigPath, SchemaPath);
                if (cv.Validate(true) != 0)
                {
                    throw new InvalidDataException("XSD-based Validation Failed.  Check for errors.");
                }

                var cf = new ConfigWriter(ConfigPath);
                cf.Write();
                Saved.Text      = "Saved newrelic.config successfully";
                Saved.BackColor = Color.FromArgb(244, 144, 0);
                Saved.Visible   = true;
                _savedTimer.Start();
            }
            catch (Exception ex)
            {
                log.Error("01 - " + ex.Message);
                Saved.Text      = ex.Message;
                Saved.BackColor = Color.DarkRed;
                Saved.Visible   = true;
                _savedTimer.Start();
            }
        }
Example #2
0
        public HttpScraper(string sourceUri, string xpath)
        {
            web           = new FormProcessorWeb(true);
            web.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)";
            processor     = new FormProcessor(web);

            form = processor.GetForm(sourceUri, xpath, FormQueryModeEnum.Nested);
        }
Example #3
0
 public FormService(ACFormsDbContext dbContext, UiPathFormsContext uiPathFormsContext, FormProcessor formProcessor, PreFillProcessor preFillProcessor, IFormAttachmentService attachmentService)
 {
     _db                = dbContext;
     _uiPathDb          = uiPathFormsContext;
     _formProcessor     = formProcessor;
     _preFillProcessor  = preFillProcessor;
     _attachmentService = attachmentService;
 }
Example #4
0
    //create a new model
    public Trunk(IFormConfiguration formConfig, ColourConfiguration colourConfig)
    {
        localFormConfig   = formConfig;
        localColourConfig = colourConfig;

        FormProcessor formProcessor = formConfig.getFormProcessor();

        formBounds = new FormBounds(formConfig.getStartPosition());
        formProcessor.createTrunk(branches, formBounds, formConfig, colourConfig);
    }
        void UpdateElements(ChangeEventArgs c)
        {
            // unable to get onchange to fire with <InputText> but OK with <input />

            // ValidationMessage support is nice because it works with js in the browser
            // However I have not been able to bind to a model.property dynamically
            // Using oninput means the server is called at every keystroke, so no
            // likely performance issues if use own validation (round trip likely to take more time)
            // PLUS intention is to use in browser version, and want to validate using other field values
            _formElement.Value = c.Value.ToString();
            // call method to change the other elements
            FormProcessor.UpdateElementsAsync(Elements, AllSettings, FormDisplayOnly);
        }
Example #6
0
        /// <summary>
        /// Click event handler for the show advanced items button INSIDE the Advanced dropdown.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void showAdvancedCheckBox_Click(object sender, EventArgs e)
        {
            AdvancedPanel.Visible = false;
            if (showAdvancedCheckBox.Checked)
            {
                showAdvancedCheckBox.Text = "Hide Advanced Items";
            }
            else
            {
                showAdvancedCheckBox.Text = "Show Advanced Items";
            }
            var formProcessor = new FormProcessor(ContentFlow);

            MultiLineCollection.Instance.Clear();
            ShowAdvanced = showAdvancedCheckBox.Checked;
            LoadUI();
        }
        private async Task ChangeTime(int interval)
        {
            _timeSpan += TimeSpan.FromMinutes(interval);
            if (IsStart)
            {
                _block.Start = _block.Start.Date.Add(_timeSpan);
            }
            else
            {
                _block.Duration = _timeSpan;
            }
            SetAllowSettings();
            SetValueString();
            // Elements is updated
            await FormProcessor.UpdateElementsAsync(Elements, AllParams, DisplayOnly);

            await BlockChanged.InvokeAsync(_block);
        }
Example #8
0
    public Branch(int offset,
                  IFormConfiguration formConfig,
                  ColourConfiguration colourConfig,
                  Vector3 branchStartPosition,
                  Vector3 branchStartTwist,
                  Vector3 origin,
                  FormBounds formBounds)
    {
        FormProcessor formProcessor = formConfig.getFormProcessor();

        formProcessor.createBranch(stacks,
                                   offset,
                                   formConfig,
                                   colourConfig,
                                   branchStartPosition,
                                   branchStartTwist,
                                   origin,
                                   formBounds);
    }
Example #9
0
        /// <summary>
        /// Click event handler for saving the new config file to a new location. Validates prior to saving.  Displays the error/save message box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveFileAs_Click(object sender, EventArgs e)
        {
            try
            {
                var formProcessor = new FormProcessor(ContentFlow);

                var cv = new ConfigValidator(ConfigPath, SchemaPath);
                if (cv.Validate(true) != 0)
                {
                    throw new InvalidDataException("XSD-based Validation Failed.  Check for errors.");
                }

                var cf = new ConfigWriter();

                var safeFile = new SaveFileDialog();
                safeFile.Title            = "Select the new location for the newrelic.config file";
                safeFile.FileName         = "newrelic.config";
                safeFile.Filter           = "config files (*.config)|*.config|All files (*.*)|*.*";
                safeFile.FilterIndex      = 0;
                safeFile.RestoreDirectory = true;

                if (safeFile.ShowDialog() == DialogResult.OK)
                {
                    cf.Write(safeFile.FileName);
                }

                Saved.Text      = "Saved newrelic.config successfully";
                Saved.BackColor = Color.FromArgb(244, 144, 0);
                Saved.Visible   = true;
                _savedTimer.Start();
            }
            catch (Exception ex)
            {
                log.Error(ex);
                Saved.Text      = ex.Message;
                Saved.BackColor = Color.DarkRed;
                Saved.Visible   = true;
                _savedTimer.Start();
            }
        }
Example #10
0
        private void btnEditResponseProcessor_Click(object sender, EventArgs e)
        {
            if (lViewResponseProcessor.SelectedItems.Count < 1)
            {
                return;
            }
            int i = lViewResponseProcessor.Items.IndexOf(lViewResponseProcessor.SelectedItems[0]);

            FormProcessor formP = new FormProcessor(_param, _config.ResponseMessageProcessors[i]);

            if (formP.ShowDialog() == DialogResult.OK)
            {
                _config.ResponseMessageProcessors[i].Name        = formP.Processor.Name;
                _config.ResponseMessageProcessors[i].DeviceName  = formP.Processor.DeviceName;
                _config.ResponseMessageProcessors[i].Description = formP.Processor.Description;
                _config.ResponseMessageProcessors[i].Setting     = formP.Processor.Setting;

                lViewResponseProcessor.SelectedItems[0].SubItems[1].Text = _config.ResponseMessageProcessors[i].Name;
                lViewResponseProcessor.SelectedItems[0].SubItems[2].Text = _config.ResponseMessageProcessors[i].DeviceName;
                lViewResponseProcessor.SelectedItems[0].SubItems[3].Text = _config.ResponseMessageProcessors[i].Description;
            }
        }
Example #11
0
        private void btnAddResponseProcessor_Click(object sender, EventArgs e)
        {
            ProcessorInstance pi = new ProcessorInstance();

            pi.Name        = "";
            pi.DeviceName  = ProcessorFactory.ProcessorRegistry[0].ToString();
            pi.Description = "";
            pi.Setting     = "";

            FormProcessor formP = new FormProcessor(_param, pi);

            if (formP.ShowDialog() == DialogResult.OK)
            {
                _config.ResponseMessageProcessors.Add(formP.Processor);
                ListViewItem lvi = new ListViewItem((lViewResponseProcessor.Items.Count + 1).ToString());
                lvi.SubItems.Add(formP.Processor.Name);
                lvi.SubItems.Add(formP.Processor.DeviceName);
                lvi.SubItems.Add(formP.Processor.Description);

                lViewResponseProcessor.Items.Add(lvi);
            }
        }
Example #12
0
    //mutate model
    public void mutate(IFormConfiguration formConfig, ColourConfiguration colourConfig)
    {
        //if we are receiving null configs then this is rendering on scene and not current brush
        //so use local configs
        if (formConfig == null)
        {
            formConfig = localFormConfig;
        }
        if (colourConfig == null)
        {
            colourConfig = localColourConfig;
        }

        //increment colour once for each trunk
        colourConfig.incrementDisplayColour();
        //increment pulse once for each trunk
        colourConfig.incrementPulseCount();

        FormProcessor formProcessor = formConfig.getFormProcessor();

        formBounds = new FormBounds(formConfig.getStartPosition());
        formProcessor.mutateTrunk(branches, formBounds, formConfig, colourConfig);
    }
Example #13
0
 public void setFormProcessor(FormProcessor formProcessor)
 {
     formProcessor.sanitiseConfiguration (this);
     this.formProcessor = formProcessor;
 }
Example #14
0
 public void setFormProcessor(FormProcessor formProcessor)
 {
     formProcessor.sanitiseConfiguration(this);
     this.formProcessor = formProcessor;
 }