Пример #1
0
        private void tableList_EditingStopped(object sender, ZForge.Controls.XPTable.Events.CellEditEventArgs e)
        {
            Table          table  = this.tableList;
            Row            row    = table.TableModel.Rows[e.Row];
            UpdateSite     us     = row.Tag as UpdateSite;
            TextCellEditor editor = e.Editor as TextCellEditor;
            string         v      = (editor.TextBox.Text != null) ? editor.TextBox.Text.Trim() : null;

            if (v == null || v.Length == 0)
            {
                e.Cancel = true;
                return;
            }
            switch (e.Column)
            {
            case 0:
                us.Description = v;
                break;

            case 1:
                List <string> msgs = new List <string>();
                if (false == ZForge.Configuration.Validator.ValidateURL(msgs, Translator.Instance.T("地址(URL)"), v))
                {
                    MessageBox.Show(ZForge.Configuration.Validator.MergeMessages(msgs), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    e.Cancel = true;
                }
                else
                {
                    us.URL = v;
                }
                break;
            }
            this.AutosizeColumnWidth();
        }
Пример #2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            UpdateSite us = new UpdateSite("http://127.0.0.1", Translator.Instance.T("新增更新服务器"));

            this.ListAdd(us);
            this.UpdateSiteCollection.Add(us);
        }
Пример #3
0
        protected virtual Row ListAdd(UpdateSite us)
        {
            Table table = this.tableList;                   // The Table control on a form - already initialised
            Row   row   = new Row(
                new Cell[] {
                new Cell(us.Description),
                new Cell(us.URL)
            }
                );

            row.Tag = us;
            table.TableModel.Rows.Add(row);
            this.AutosizeColumnWidth();
            return(row);
        }
Пример #4
0
        public bool Upgrade()
        {
            UpdateSite us = this.comboBoxURL.SelectedItem as UpdateSite;

            if (us != null)
            {
                this.URL = us.URL + "/" + this.URLSuffix;
                StepCheck();
                return(true);
            }
            else
            {
                this.logViewer.LogAdd(new LogItem(LogLevel.LOG_ERROR, Translator.Instance.T("未选择更新服务器.")));
                return(false);
            }
        }
Пример #5
0
 private void toolStripButtonAdd_Click(object sender, EventArgs e)
 {
     UpdateSite us = new UpdateSite("http://127.0.0.1", Translator.Instance.T("�������·�����"));
     this.ListAdd(us);
     this.UpdateSiteCollection.Add(us);
 }
Пример #6
0
 protected virtual Row ListAdd(UpdateSite us)
 {
     Table table = this.tableList;       // The Table control on a form - already initialised
     Row row = new Row(
         new Cell[] {
             new Cell(us.Description),
             new Cell(us.URL)
         }
     );
     row.Tag = us;
     table.TableModel.Rows.Add(row);
     this.AutosizeColumnWidth();
     return row;
 }