Exemple #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Checks to see that SFM/Toolbox data source files actually contain the markers
        /// that have been mapped to PA fields.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public bool VerifyMappings()
        {
            if (Type != DataSourceType.Toolbox && Type != DataSourceType.SFM)
            {
                return(true);
            }

            m_markersInFile = null;
            var badMappingFound = false;
            var markers         = GetSfMarkers(false).ToArray();

            for (int i = FieldMappings.Count - 1; i >= 0; i--)
            {
                if (!markers.Contains(FieldMappings[i].NameInDataSource))
                {
                    FieldMappings.RemoveAt(i);
                    badMappingFound = true;
                }
            }

            return(!badMappingFound);
        }