Exemple #1
0
        void AddWord(string word, long value)
        {
            if (String.IsNullOrEmpty(word))
            {
                MessageBox.Show("Invalid value");
                return;
            }

            bool writeRes = trie.TryWrite(word, value);

            if (writeRes)
            {
                if (String.IsNullOrEmpty(txtLog.Text))
                {
                    txtLog.Text = word + " - " + value;
                }
                else
                {
                    txtLog.Text += Environment.NewLine + word + " - " + value;
                }
            }
            else
            {
                MessageBox.Show("Failed adding new value. Please try to free some space.");
            }
        }