Пример #1
0
        // RBF Library link

        private void InsertFromLibraryToolStripMenuItemDropDownOpening(object sender, EventArgs e)
        {
            insertFromLibraryToolStripMenuItem.DropDownItems.Clear();
            TreeNode selected = m_trvTables.SelectedNode;

            if (selected == null)
            {
                return;
            }
            SortedDictionary <string, RBFLibEntry> entries = RBFLibrary.GetEntriesForTag(selected.Text);

            if (entries == null)
            {
                return;
            }

            foreach (var entry in entries)
            {
                ToolStripMenuItem menu = insertFromLibraryToolStripMenuItem;
                if (entry.Value.Submenu != null)
                {
                    string subname = entry.Value.Submenu;
                    if (!insertFromLibraryToolStripMenuItem.DropDownItems.ContainsKey(subname))
                    {
                        var s = new ToolStripMenuItem(subname)
                        {
                            Name = subname
                        };
                        insertFromLibraryToolStripMenuItem.DropDownItems.Add(s);
                        menu = s;
                    }
                    else
                    {
                        menu = insertFromLibraryToolStripMenuItem.DropDownItems[subname] as ToolStripMenuItem;
                    }
                }
                ToolStripItem rbfLibItem = menu.DropDownItems.Add(entry.Key);
                rbfLibItem.Click += RBFLibItemClick;
            }
        }
Пример #2
0
        private void RBFLibItemClick(object sender, EventArgs e)
        {
            var      item     = sender as ToolStripItem;
            TreeNode selected = m_trvTables.SelectedNode;

            if (selected == null)
            {
                return;
            }
            SortedDictionary <string, RBFLibEntry> entries = RBFLibrary.GetEntriesForTag(selected.Text);

            if (entries == null || !entries.ContainsKey(item.Text))
            {
                return;
            }
            List <AttributeValue> values = entries[item.Text].Values;

            foreach (AttributeValue value in values)
            {
                InsertValueIntoSelected(value);
            }
        }
        private void TbxTagFilterTextChanged(object sender, EventArgs e)
        {
            _lbxEntries.Items.Clear();
            SortedDictionary <string, RBFLibEntry> entries = _tbx_tagFilter.Text == string.Empty ? RBFLibrary.GetAllEntries() : RBFLibrary.GetEntriesForTag(_tbx_tagFilter.Text);

            if (entries == null)
            {
                return;
            }

            foreach (RBFLibEntry entry in entries.Values)
            {
                _lbxEntries.Items.Add(entry);
            }
        }