/// <summary>
    /// Edits the selected Property Definition.
    /// </summary>
    private void EditPropertyDefinition()
    {
        // Need to get the selected domain
        Domain domain = propertyListCtl.GetSelectedDomain();

        PropertyDefinitionEntryDlg dlg = new PropertyDefinitionEntryDlg();

        if (dlg.DoModal(this, domain))
        {
            log.Info("OK pressed on PropertyDefinitionEntryDlg");
            if (domain.Dirty)
            {
                if (ConfigurationManager.AppSettings[DISPLAY_SQL_CFG].Equals("true"))
                {
                    BufferDisplayDlg bdDlg = new BufferDisplayDlg();
                    bdDlg.DoModal(this, domain);
                }
                if (ConfigurationManager.AppSettings[UPDATE_DB_CFG].Equals("true"))
                {
                    domain.Save();
                }
                propertyListCtl.UpdateSelectedLabel();
            }
        }
    }
    /// <summary>
    /// Adds a new Property Definition.
    /// </summary>
    private void AddPropertyDefinition()
    {
        // Create a new Application domain
        Domain selDomain = propertyListCtl.GetSelectedDomain();

        Domain domain = DomainFactory.Create("PropertyDefinition");
        if (selDomain != null)
        {
            domain.SetValue("Category", selDomain.GetValue("Category"));
        }

        PropertyDefinitionEntryDlg dlg = new PropertyDefinitionEntryDlg();

        if (dlg.DoModal(this, domain))
        {
            log.Info("OK pressed on PropertyDefinitionEntryDlg");
            if (ConfigurationManager.AppSettings[DISPLAY_SQL_CFG].Equals("true"))
            {
                BufferDisplayDlg bdDlg = new BufferDisplayDlg();
                bdDlg.DoModal(this, domain);
            }
            if (ConfigurationManager.AppSettings[UPDATE_DB_CFG].Equals("true"))
            {
                domain.Save();
            }

            propertyListCtl.AddDomain(domain);
        }
    }