Ejemplo n.º 1
0
 internal void ApplyFilters(FilterSet filters)
 {
     this.currentSearchText         = filters.GlobalSearchText;
     this.refreshViewOnFilterChange = false;
     foreach (var column in this.ColumnConfig.Columns)
     {
         column.FilterValue = filters.ColumnFilters.GetValueOrDefault(column.DataField) ?? String.Empty;
     }
     this.refreshViewOnFilterChange = true;
     this.logEntriesView.Refresh();
 }
Ejemplo n.º 2
0
        internal FilterSet GetCurrentFilters()
        {
            FilterSet filters = new FilterSet();

            filters.GlobalSearchText = this.currentSearchText;
            foreach (var column in this.ColumnConfig.Columns)
            {
                if (String.IsNullOrWhiteSpace(column.FilterValue))
                {
                    continue;
                }
                filters.ColumnFilters[column.DataField] = column.FilterValue;
            }
            return(filters);
        }
Ejemplo n.º 3
0
        protected async void OpenLogFile(string filename, bool preserveFilters)
        {
            this.IsLoading   = true;
            this.DisplayName = TITLE;
            try
            {
                FilterSet filters = null;
                if (preserveFilters)
                {
                    filters = this.LogView.GetCurrentFilters();
                }
                bool openedLog = await Task.Run(() => this.LogView.OpenLog(filename));

                if (openedLog)
                {
                    this.DisplayName = String.Format("{0} [{1}]", TITLE, filename);
                    Properties.Settings.Default.LastLogfile = filename;
                    this.CurrentLogFile = filename;
                    if (!this.mruFiles.Contains(filename))
                    {
                        this.mruFiles.Insert(0, filename);
                    }
                }
                else
                {
                    this.CurrentLogFile = null;
                }
                if ((preserveFilters) && (filters != null))
                {
                    this.LogView.ApplyFilters(filters);
                }
                this.IsLogLoaded = openedLog;
            }
            finally
            {
                this.IsLoading = false;
            }
        }