protected override IList <Tuple <string, ContactProp?, IList <string> > > CreateMapping()
    {
        Debug.Assert(Analyzer.HasHeaderRow == true);
        Debug.Assert(Analyzer.ColumnNames != null);

        IList <Tuple <string, ContactProp?, IList <string> > >?mapping = HeaderRow.GetMappingEN();

        if (Analyzer.ColumnNames.Where(s => mapping.Any(tpl => tpl.Item2.HasValue && StringComparer.OrdinalIgnoreCase.Equals(tpl.Item3[0], s))).Count() > 3)
        {
            return(mapping);
        }
        else
        {
            // Spaltenreihenfolge

            var end = Math.Min(mapping.Count, Analyzer.ColumnNames.Count);

            for (int i = 0; i < end; i++)
            {
                mapping[i].Item3[0] = Analyzer.ColumnNames[i];
            }

            for (int i = end; i < mapping.Count; i++)
            {
                Tuple <string, ContactProp?, IList <string> >?currentTpl = mapping[i];
                mapping[i] = new Tuple <string, ContactProp?, IList <string> >(currentTpl.Item1, null, EmptyStringArray);
            }
        }

        return(mapping);
    }
示例#2
0
 protected override IList <Tuple <string, ContactProp?, IList <string> > > CreateMapping() => HeaderRow.GetMappingEN();