예제 #1
0
        internal static void LoadMappingProfilesFromXml()
        {
            MappingProfiles = new List <MappingProfile>();
            try
            {
                if (GlobalVars.SETTINGS.metadata_MappingProfiles == null)
                {
                    XmlDocument doc = new XmlDocument();
                    doc.AppendChild(doc.CreateElement("root"));
                    GlobalVars.SETTINGS.metadata_MappingProfiles = doc;
                }

                foreach (XmlElement xNode in GlobalVars.SETTINGS.metadata_MappingProfiles.DocumentElement.ChildNodes)
                {
                    string         name = xNode.Attributes["ProfileName"].InnerText;
                    string         targetContentTypeName = xNode.Attributes["TargetContentTypeName"].InnerText;
                    MappingProfile mp = new MappingProfile(name, targetContentTypeName);
                    mp.MappingItems = new List <MappingItem>();
                    foreach (XmlElement x2 in xNode.ChildNodes)
                    {
                        MappingItem mi = new MappingItem(x2.Attributes["SourceColumn"].InnerText, x2.Attributes["DestColumn"].InnerText);
                        mp.MappingItems.Add(mi);
                    }
                    mp.MappingItems.Sort();
                    MappingProfiles.Add(mp);
                }
            }
            catch (Exception ex)
            {
                Eh.GlobalErrorHandler(ex);
            }
        }
예제 #2
0
        private void cboClearAMapping_SelectedIndexChanged(object sender, EventArgs e)
        {
            MappingItem miDeleted = (MappingItem)cboClearAMapping.SelectedItem;

            m_mpWorking.MappingItems.Remove(miDeleted);
            cboClearAMapping.Visible = false;
            displayMappingProfileInRtb(miDeleted.ToString(), "deleted");
        }
예제 #3
0
        private void btnAddMap_Click(object sender, EventArgs e)
        {
            if (lstSource.SelectedItem == null || lstDest.SelectedItem == null)
            {
                return;
            }

            FieldAndContentType fcS = (FieldAndContentType)lstSource.SelectedItem;
            FieldAndContentType fcD = (FieldAndContentType)lstDest.SelectedItem;

            //lstSource.Items.Remove(fcS);
            //lstDest.Items.Remove(fcD);

            MappingItem mi = new MappingItem(fcS.Field.InternalName, fcD.Field.InternalName);

            m_mpWorking.MappingItems.Add(mi);
            m_mpWorking.MappingItems.Sort();
            displayMappingProfileInRtb(mi.ToString(), "added");
        }