Example #1
0
        private void AddValuesToRBFDictionaryToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (m_trvTables.SelectedNode == null)
            {
                return;
            }
            if (m_collectionMode)
            {
                UIHelper.ShowError("Does not work in RBF-library.");
                return;
            }
            var rbfv = m_trvTables.SelectedNode.Tag as AttributeValue;

            if (rbfv.DataType == AttributeDataType.String)
            {
                RBFDictionary.AddDictEntry(rbfv.Key, rbfv.Data as string);
            }
            else if (rbfv.DataType == AttributeDataType.Table)
            {
                string key = rbfv.Key;
                foreach (var rbfData in (AttributeTable)rbfv.Data)
                {
                    if (rbfData.DataType != AttributeDataType.String)
                    {
                        continue;
                    }
                    RBFDictionary.AddDictEntry(key, (string)rbfData.Data);
                }
            }
        }
Example #2
0
 private void AddValueToolStripMenuItemClick(object sender, EventArgs e)
 {
     if (m_dgvValues.SelectedRows.Count <= 0 || (string)m_dgvValues.SelectedRows[0].Cells[2].Value != "string")
     {
         return;
     }
     RBFDictionary.AddDictEntry((string)m_dgvValues.SelectedRows[0].Cells[0].Value,
                                (string)m_dgvValues.SelectedRows[0].Cells[1].Value);
 }
 private void BtnCopyIntoDictionaryClick(object sender, EventArgs e)
 {
     foreach (var tmpEntry in m_chklbxEntries.CheckedItems)
     {
         DictEntry entry = tmpEntry as DictEntry;
         if (RBFDictionary.HasSearchpath(entry.Key))
         {
             if (UIHelper.ShowYNQuestion("Question", "There already exists a searchpath for key '" + entry.Key +
                                         "', remove it and replace it with regular a RBF dictionary entry?") == DialogResult.No)
             {
                 continue;
             }
             RBFDictionary.RemoveSearchpath(entry.Key);
         }
         RBFDictionary.AddDictEntry(entry.Key, entry.Options);
     }
 }