Example #1
0
 public Migration(string configFile)
 {
     if (System.IO.File.Exists(configFile))
     {
         ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
         configMap.ExeConfigFilename = configFile;
         System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
         mRS = config.GetSection("MigRules") as MigRulesSection;
         if (mRS == null)
         {
             mRS = new MigRulesSection();
         }
     }
 }
Example #2
0
        public Mapper(MigRulesSection mrs)
        {
            Dictionary <string, string> valueDict;

            foreach (MigMapping mapping in mrs.MigMappings)
            {
                string key       = mapping.Target + "|" + mapping.Source;
                string sourceval = mapping.SourceValue ?? "";
                if (!fieldDict.ContainsKey(key))
                {
                    fieldDict[key] = new Dictionary <string, string>();
                }
                valueDict = fieldDict[key];
                if (valueDict.ContainsKey(sourceval))
                {
                    valueDict[sourceval] = mapping.TargetValue;
                }
                else
                {
                    valueDict.Add(sourceval, mapping.TargetValue);
                }
            }
        }
Example #3
0
 public Migration()
 {
     this.mRS = new MigRulesSection();
 }