Beispiel #1
0
 private void InitRows()
 {
     _parser    = new BookMarkParser();
     _bookMarks = _parser.BookMarks;
     if (_bookMarks == null || _bookMarks.Count == 0)
     {
         dgvBmList.Rows.Clear();
         return;
     }
     dgvBmList.RowCount = _bookMarks.Keys.Count;
     string[] keys = _bookMarks.Keys.ToArray();
     for (int i = 0; i < keys.Length; i++)
     {
         dgvBmList.Rows[i].SetValues(keys[i]);
         dgvBmList.Rows[i].Tag = keys[i];
     }
 }
Beispiel #2
0
        //从配置文件中读取关注区的信息,并添加到DropDownButton中
        private void CreatInterstItem(object sender)
        {
            RadDropDownButtonElement dbt = sender as RadDropDownButtonElement;

            if (dbt == null)
            {
                return;
            }
            dbt.Items.Clear();
            BookMarkParser parser = new BookMarkParser();

            BookMarkGroup[] groups = parser.BookMarkGroups;
            if (groups == null || groups.Length == 0)
            {
                return;
            }
            foreach (BookMarkGroup group in groups)
            {
                RadMenuHeaderItem headItem = new RadMenuHeaderItem(group.GroupName);
                dbt.Items.Add(headItem);
                CreatBookMarkItems(dbt, group);
            }
            dbt.ShowDropDown();
        }
Beispiel #3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtTypeName.Text))
            {
                return;
            }
            bool isOk = true;

            if (_evp == null)
            {
                isOk = GetEvpFromUCRange();
            }
            if (!isOk)
            {
                return;
            }
            _name = txtName.Text;
            string         groupName = txtTypeName.Text;
            BookMarkParser parser    = new BookMarkParser();

            parser.AddBookMarkElement(groupName, _name, _evp);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }