Example #1
0
        private void FindTable(string itemPath, string text, FindOptions options, FindTableCacheInfo cacheInfo, List <FindResultInfo> results)
        {
            int index = 0;

            foreach (var row in cacheInfo.Rows)
            {
                int c = 0;
                foreach (var value in row.Values)
                {
                    if (value != null && value.IndexOf(text) >= 0)
                    {
                        var resultItem = new FindResultInfo()
                        {
                            Path             = itemPath,
                            Row              = index,
                            ColumnName       = cacheInfo.Columns[c],
                            Value            = value,
                            Tags             = row.Tags,
                            IsEnabled        = row.IsEnabled,
                            ModificationInfo = row.ModificationInfo,
                        };
                        results.Add(resultItem);
                    }
                    c++;
                }
                index++;
            }
        }
Example #2
0
        private FindTableCacheInfo BuildCache(CremaDataTable dataTable)
        {
            var columns    = dataTable.Columns.ToArray();
            var tableCache = new FindTableCacheInfo()
            {
                Columns = columns.Select(i => i.ColumnName).ToArray(),
                Rows    = this.BuildRowCache(dataTable, columns)
            };

            return(tableCache);
        }
Example #3
0
        private FindTableCacheInfo BuildCache(CremaDataType dataType)
        {
            var typeCache = new FindTableCacheInfo()
            {
                Columns = new string[] { CremaSchema.Name, CremaSchema.Value, CremaSchema.Comment }
            };
            var rowCaches = new List <FindRowCacheInfo>();

            foreach (var item in dataType.Members)
            {
                var rowCache = new FindRowCacheInfo()
                {
                    Values           = new string[] { item.Name, item.Value.ToString(), item.Comment },
                    Tags             = TagInfo.All.ToString(),
                    IsEnabled        = true,
                    ModificationInfo = item.ModificationInfo
                };
                rowCaches.Add(rowCache);
            }
            typeCache.Rows = rowCaches.ToArray();

            return(typeCache);
        }