Ejemplo n.º 1
0
        // 修改一个检索点事项
        private void button_modifyAccessPoint_Click(object sender, EventArgs e)
        {
            if (this.listView_accessPoints.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择要修改的检索点事项");
                return;
            }

            ListViewItem item = this.listView_accessPoints.SelectedItems[0];

            AccessPointDialog dlg = new AccessPointDialog();

            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.DbFromInfos = this.DbFromInfos;
            dlg.FromName    = item.Text;
            dlg.Weight      = ListViewUtil.GetItemText(item, 1);
            dlg.SearchStyle = ListViewUtil.GetItemText(item, 2);

            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return;
            }

            item.Text = dlg.FromName;
            ListViewUtil.ChangeItemText(item, 1, dlg.Weight);
            ListViewUtil.ChangeItemText(item, 2, dlg.SearchStyle);

            this.AccessPointsChanged = true;
        }
Ejemplo n.º 2
0
        // 新建一个检索点事项
        private void button_newAccessPoint_Click(object sender, EventArgs e)
        {
            AccessPointDialog dlg = new AccessPointDialog();

            MainForm.SetControlFont(dlg, this.Font, false);
            // TODO: 是否需要把当前已经选择的对象当作参考对象?
            dlg.DbFromInfos   = this.DbFromInfos;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
            {
                return;
            }

            ListViewItem new_item = new ListViewItem(dlg.FromName, 0);

            new_item.SubItems.Add(dlg.Weight);
            new_item.SubItems.Add(dlg.SearchStyle);
            this.listView_accessPoints.Items.Add(new_item);

            // TODO: 是否将来需要做成插入在当前已选择的事项前面

            this.AccessPointsChanged = true;
        }
Ejemplo n.º 3
0
        // 修改一个检索点事项
        private void button_modifyAccessPoint_Click(object sender, EventArgs e)
        {
            if (this.listView_accessPoints.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择要修改的检索点事项");
                return;
            }

            ListViewItem item = this.listView_accessPoints.SelectedItems[0];

            AccessPointDialog dlg = new AccessPointDialog();
            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.DbFromInfos = this.DbFromInfos;
            dlg.FromName = item.Text;
            dlg.Weight = ListViewUtil.GetItemText(item, 1);
            dlg.SearchStyle = ListViewUtil.GetItemText(item, 2);

            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            item.Text = dlg.FromName;
            ListViewUtil.ChangeItemText(item, 1, dlg.Weight);
            ListViewUtil.ChangeItemText(item, 2, dlg.SearchStyle);

            this.AccessPointsChanged = true;
        }
Ejemplo n.º 4
0
        // 新建一个检索点事项
        private void button_newAccessPoint_Click(object sender, EventArgs e)
        {
            AccessPointDialog dlg = new AccessPointDialog();
            MainForm.SetControlFont(dlg, this.Font, false);
            // TODO: 是否需要把当前已经选择的对象当作参考对象?
            dlg.DbFromInfos = this.DbFromInfos;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            ListViewItem new_item = new ListViewItem(dlg.FromName, 0);
            new_item.SubItems.Add(dlg.Weight);
            new_item.SubItems.Add(dlg.SearchStyle);
            this.listView_accessPoints.Items.Add(new_item);

            // TODO: 是否将来需要做成插入在当前已选择的事项前面

            this.AccessPointsChanged = true;
        }