Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //--validate
            if (cboTargetContentType.SelectedItem == null)
            {
                SmartStepUtil.AddToRTB(rtbDisplay, "Target Content Type is blank.", Color.Red, 10, true);
                return;
            }

            //--
            if (m_editingMPindex == -1) //--Mapping Profile is new
            {
                ActionMetaDataUtil.MappingProfiles.Add(m_mpWorking);
            }
            else
            {
                ActionMetaDataUtil.MappingProfiles[m_editingMPindex] = m_mpWorking;
            }

            //--refresh cboMappingProfile
            ActionMetadata.DefInstance.populateCboMappingProfiles();
            //ActionMetadata.DefInstance.cboMappingProfile.SelectedItem = m_mpWorking;
            ActionMetadata.DefInstance.cboMappingProfile.SelectedIndex = ActionMetadata.DefInstance.cboMappingProfile.FindStringExact(m_mpWorking.ProfileName);
            //ActionMetadata.DefInstance.cboMappingProfile.Refresh();
            //--
            ActionMetaDataUtil.SaveMappingProfileToXml();
            //

            //--
            ActionMetadata.DefInstance.rtbDisplay.Clear();
            this.Close();
        }
Beispiel #2
0
        private void lnkDeleteProfile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DialogResult ret = MessageBox.Show(this, "Are you sure you want to delete Mapping Profile " + m_mpWorking.ProfileName + "?", "", MessageBoxButtons.YesNo);

            if (ret == DialogResult.Yes)
            {
                ActionMetaDataUtil.MappingProfiles.RemoveAt(m_editingMPindex);
                ActionMetaDataUtil.SaveMappingProfileToXml();
                ActionMetadata.DefInstance.populateCboMappingProfiles();
                ActionMetadata.DefInstance.lnkEditProfiles.Enabled = false;
                ActionMetadata.DefInstance.lnkCopyProfile.Enabled  = false;
                this.Close();
            }
        }
Beispiel #3
0
        private void lnkCopyProfile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            MappingProfile mp     = (MappingProfile)cboMappingProfile.SelectedItem;
            MappingProfile mpCopy = (MappingProfile)Util.DeepCopy(mp);

            if (mpCopy == null)
            {
                return;
            }
            ActionMetaDataUtil.MappingProfiles.Add(mpCopy);
            mpCopy.ProfileName = "Copy of " + mpCopy.ProfileName;
            cboMappingProfile.Items.Add(mpCopy);
            cboMappingProfile.SelectedItem = mpCopy;
            ActionMetaDataUtil.SaveMappingProfileToXml();
        }