Exemple #1
0
        private void SetupSpecialUtilizations(ref SetMapping mapping, HiToTextEntryFieldNameSpecialUtilization[] specialUtilizations)
        {
            mapping.SpecialUtilizations = SetMapping.GetSpecialUtilizations(specialUtilizations);

            if (mapping.HasSpecialUtilization(SetMapping.SpecialUtilization.DetermineRank))
                mapping.DetermineRank = GetRankFunction(specialUtilizations);
            if (mapping.HasSpecialUtilization(SetMapping.SpecialUtilization.IncomingModified))
                mapping.IncomingModifiedFunction = GetIMF(specialUtilizations);
        }
Exemple #2
0
        private List<SetMapping> SetupMappings(HiToTextEntry entry)
        {
            List<SetMapping> toReturn = new List<SetMapping>();

            foreach (HiToTextEntryFieldName fieldName in entry.SetStructure)
            {
                SetMapping mapping = new SetMapping(fieldName.Name);
                mapping.FieldType = Type.GetType(GetValidFieldType(fieldName.FieldType));
                mapping.ConversionType = fieldName.ConversionType;

                if (fieldName.ConstantSpecified)
                    mapping.Data = fieldName.Constant;
                if (fieldName.ExternalWrapper != null)
                    mapping.ExternalWrapper = GetWrapper(fieldName.ExternalWrapper);

                if (fieldName.ConversionType.ToUpper().Equals("NAME"))
                {
                    if (mapping.ExternalWrapper != null)
                        mapping.ConversionMethod = SetScore.ConvertName(tParams, mapping.ExternalWrapper);
                    else
                        mapping.ConversionMethod = SetScore.ConvertName(tParams);
                }
                else if (fieldName.ConversionType.ToUpper().Equals("SWITCH"))
                    mapping.ConversionMethod = SetScore.ConvertSwitch(switchMaps[fieldName.Name]);

                string[] sPositions = fieldName.Position.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                mapping.Positions = new int[sPositions.Length];
                for (int i = 0; i < sPositions.Length; i++)
                    mapping.Positions[i] = Convert.ToInt32(sPositions[i]);

                SetupSpecialUtilizations(ref mapping, fieldName.SpecialUtilization);

                toReturn.Add(mapping);
            }

            return toReturn;
        }