Ejemplo n.º 1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var aprop = (DataPropertyDefinition)cmbAssociatedProperty.SelectedItem;
            var rprop = (DataPropertyDefinition)cmbActiveProperty.SelectedItem;

            Debug.Assert(aprop != null);
            Debug.Assert(rprop != null);

            var map = new KeyMapping(rprop.Name, aprop.Name);
            _mappings.Add(map);

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            var aprop = (DataPropertyDefinition)cmbAssociatedProperty.SelectedItem;
            var rprop = (DataPropertyDefinition)cmbActiveProperty.SelectedItem;

            Debug.Assert(aprop != null);
            Debug.Assert(rprop != null);

            var map = new KeyMapping(rprop.Name, aprop.Name);

            _mappings.Add(map);

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Helper method to set the identity and reverse identity properties
        /// </summary>
        /// <param name="map"></param>
        internal void AddKeyMapping(KeyMapping map)
        {
            var aids = _a.IdentityProperties;
            var rids = _a.ReverseIdentityProperties;

            Debug.Assert(aids.Count == rids.Count);

            var acls = (ClassDefinition)_a.Parent;
            var rcls = _a.AssociatedClass;

            var ap = acls.Properties[map.Primary];
            var rp = rcls.Properties[map.Foreign];

            Debug.Assert(ap.PropertyType == rp.PropertyType);
            Debug.Assert(ap.PropertyType == PropertyType.PropertyType_DataProperty);

            aids.Add((DataPropertyDefinition)ap);
            rids.Add((DataPropertyDefinition)rp);
        }