Ejemplo n.º 1
0
        void saveButton_Click(object sender, EventArgs e)
        {
            BrowserScriptPocketQueriesPQSetting pq = BrowserScriptPocketQueriesPQSetting.FromPQPage(Core, this.OwnerPlugin, Browser);

            if (pq != null)
            {
                try
                {
                    List <BrowserScriptPocketQueriesPQSetting> l   = BrowserScriptPocketQueriesPQSetting.Load(_settingsFileName);
                    BrowserScriptPocketQueriesPQSetting        pqs = (from p in l where p.Name == pq.Name select p).FirstOrDefault();
                    if (pqs != null)
                    {
                        pq.ID = pqs.ID;
                        l.Remove(pqs);
                    }
                    l.Add(pq);
                    BrowserScriptPocketQueriesPQSetting.Save(_settingsFileName, l);
                    MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_SETTINGSSAVED));
                }
                catch
                {
                    MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR));
                }
            }
            else
            {
                MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR));
            }
        }
        public BrowserScriptPocketQueriesPQSeriesForm(Framework.Interfaces.ICore core, Framework.Interfaces.IPlugin plugin, string settingsFilename, string seriesFilename, WebBrowser wb)
            : this()
        {
            _settingsFilename = settingsFilename;
            _seriesFilename   = seriesFilename;
            _core             = core;
            _wb     = wb;
            _plugin = plugin;

            List <BrowserScriptPocketQueriesPQSetting> s = BrowserScriptPocketQueriesPQSetting.Load(settingsFilename);

            if (s != null)
            {
                comboBox2.Items.AddRange(s.ToArray());
            }

            List <BrowserScriptPocketQueriesPQSeries> l = BrowserScriptPocketQueriesPQSeries.Load(_seriesFilename);

            if (l != null)
            {
                comboBox1.Items.AddRange(l.ToArray());
            }

            this.Text         = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATEPQ);
            this.label1.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_SERIE);
            this.label4.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
            this.label6.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_SETTINGS);
            this.label12.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TEMPLATE);
            this.label8.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_START);
            this.label10.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_END);
            this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DATE);
            this.button1.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE);
            this.button12.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_RENAME);
            this.button2.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
            this.button4.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_NEW);
            this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTODATERANGES);
            this.label14.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINPQ);
            this.label16.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MAXINLASTPQ);
            this.button7.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMSELECTION);
            this.button8.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_NETHERLANDS);
            this.button9.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_BELGIUM);
            this.label21.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_DELAY);
            this.label19.Text   = Utils.LanguageSupport.Instance.GetTranslation(STR_MARGIN);
            this.button11.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATIC);
            this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOMATICACTIVATE);
            this.button13.Text  = Utils.LanguageSupport.Instance.GetTranslation(STR_FROMGCPROJECT);
        }
Ejemplo n.º 3
0
        public BrowserScriptPocketQueriesPQSettingForm(string filename)
            : this()
        {
            _filename = filename;
            List <BrowserScriptPocketQueriesPQSetting> l = BrowserScriptPocketQueriesPQSetting.Load(_filename);

            if (l != null)
            {
                listBox1.Items.AddRange(l.ToArray());
            }

            this.Text         = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
            this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REMOVE);
            this.button2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
            this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK);
        }