Inheritance: System.Windows.Forms.Form
        private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var acls = _ap.AssociatedClass;
            var rcls = (ClassDefinition)_ap.DecoratedObject.Parent;

            if (acls == null)
            {
                MessageBox.Show("Please set the associated class first");
                return;
            }

            var aprops = new List <DataPropertyDefinition>();

            foreach (PropertyDefinition p in acls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                {
                    aprops.Add((DataPropertyDefinition)p);
                }
            }
            var rprops = new List <DataPropertyDefinition>();

            foreach (PropertyDefinition p in rcls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                {
                    rprops.Add((DataPropertyDefinition)p);
                }
            }

            if (aprops.Count == 0)
            {
                MessageBox.Show("Associated class has no data properties to map");
                return;
            }

            if (rprops.Count == 0)
            {
                MessageBox.Show("This class has no data properties to map");
                return;
            }

            var dlg = new AddMappingDialog(_mappings, acls, rcls);

            dlg.ShowDialog();
        }
        private void lnkAdd_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var acls = _ap.AssociatedClass;
            var rcls = (ClassDefinition)_ap.DecoratedObject.Parent;

            if (acls == null)
            {
                MessageBox.Show("Please set the associated class first");
                return;
            }

            var aprops = new List<DataPropertyDefinition>();
            foreach (PropertyDefinition p in acls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                    aprops.Add((DataPropertyDefinition)p);
            }
            var rprops = new List<DataPropertyDefinition>();
            foreach (PropertyDefinition p in rcls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                    rprops.Add((DataPropertyDefinition)p);
            }

            if (aprops.Count == 0)
            {
                MessageBox.Show("Associated class has no data properties to map");
                return;
            }

            if (rprops.Count == 0)
            {
                MessageBox.Show("This class has no data properties to map");
                return;
            }

            var dlg = new AddMappingDialog(_mappings, acls, rcls);
            dlg.ShowDialog();
        }