/// <summary>
        /// Destroys the GUI elements.
        /// </summary>
        public void Destroy()
        {
            if (guiLayout != null)
            {
                guiLayout.Destroy();
                guiLayout = null;
            }

            guiLayout      = null;
            guiTitleLayout = null;
            guiChildLayout = null;

            for (int i = 0; i < rows.Count; i++)
            {
                rows[i].Destroy();
            }

            rows.Clear();

            if (editRow != null)
            {
                editRow.Destroy();
            }

            editRow = null;
        }
        /// <summary>
        /// Completely rebuilds the dictionary GUI elements.
        /// </summary>
        public void BuildGUI()
        {
            editKey   = CreateKey();
            editValue = CreateValue();

            UpdateHeaderGUI();

            foreach (var KVP in rows)
            {
                KVP.Value.Destroy();
            }

            rows.Clear();

            if (editRow != null)
            {
                editRow.Destroy();
                editRow = null;
            }

            if (!IsNull())
            {
                // Hidden dependency: BuildGUI must be called after all elements are
                // in the dictionary so we do it in two steps
                int numRows = GetNumRows();
                for (int i = 0; i < numRows; i++)
                {
                    GUIDictionaryFieldRow newRow = CreateRow();
                    rows.Add(i, newRow);
                }

                editRow = CreateRow();
                editRow.Initialize(this, guiContentLayout, numRows, depth + 1);
                editRow.Enabled = false;

                for (int i = 0; i < numRows; i++)
                {
                    rows[i].Initialize(this, guiContentLayout, i, depth + 1);
                }
            }
        }