public override bool ValidateMappings(PhaidraMapping mapping)
        {
            bool hasabsolutefilepathMapping      = false;
            bool hasrelativefilepathMapping      = false;
            bool hasabsolutedirectorypathMapping = false;
            bool hasrelativedirectorypathMapping = false;
            bool hasfilenameMapping = false;

            foreach (var m in mapping.PhaidraAttributeFields2CsvColumns)
            {
                switch (m.Field.Key)
                {
                case CONST_absolutefilepath:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasabsolutefilepathMapping = true;
                    }
                    break;

                case CONST_relativefilepath:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasrelativefilepathMapping = true;
                    }
                    break;

                case CONST_absolutedirectorypath:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasabsolutedirectorypathMapping = true;
                    }
                    break;

                case CONST_relativedirectorypath:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasrelativedirectorypathMapping = true;
                    }
                    break;

                case CONST_filename:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasfilenameMapping = true;
                    }
                    break;
                }
            }
            // XOR
            mapping.IsValid =
                hasabsolutefilepathMapping ||
                hasrelativefilepathMapping && hasfilenameMapping ||
                hasabsolutedirectorypathMapping && hasfilenameMapping ||
                hasrelativedirectorypathMapping && hasfilenameMapping;

            return(mapping.IsValid);
        }
        public override bool ValidateMappings(PhaidraMapping mapping)
        {
            bool hasPhaidraIdMapping = false;

            foreach (var m in mapping.PhaidraAttributeFields2CsvColumns)
            {
                switch (m.Field.Key)
                {
                case CONST_phaidraid:
                    if (m.SelectedCsvColumn != CsvColumn.Empty)
                    {
                        hasPhaidraIdMapping = true;
                    }
                    break;
                }
            }

            mapping.IsValid = hasPhaidraIdMapping;
            return(mapping.IsValid);
        }
Esempio n. 3
0
 public virtual bool ValidateMappings(PhaidraMapping mapping)
 {
     return(true);
 }