/// <summary>
        /// Gets the list of properties to map to columns in the csv (in the order they appear in the csv)
        /// </summary>
        /// <returns></returns>
        public Dictionary <int, string> GetProperties()
        {
            // get enabled columns that are mapped to properties
            var enabledColumns = EnabledColumns.ToList();

            // create dictionary mapping column indexes to properties
            var propertiesByIndex = new Dictionary <int, string>();

            // map indexes to properties
            for (var i = 0; i < enabledColumns.Count; i++)
            {
                propertiesByIndex.Add(i, enabledColumns[i].MappedProperty);
            }

            // return mapped properties
            return(propertiesByIndex);
        }
示例#2
0
        public void UpdateFilter()
        {
            StringBuilder sb = new StringBuilder();

            var columns = EnabledColumns.ToList();

            bool first = true;

            foreach (var column in EnabledColumns)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    sb.Append(" OR ");
                }

                sb.AppendFormat("{0} LIKE '*{1}*'", column, EscapeExpression(FilterText));
            }

            Filter = sb.ToString();
        }
 /// <summary>
 /// Gets the collection of tags to include for the query
 /// </summary>
 /// <returns></returns>
 public string GetTagsString()
 {
     return(string.Join(string.Empty, EnabledColumns.Select(t => t.Tag)));
 }