public void Restore(TailViewModel view,TailViewState tailviewstate)
 {
     _logger.Info("Applying {0} saved search settings  for {1} ", tailviewstate.SearchItems.Count(), view.Name);
     var searches = tailviewstate.SearchItems.Select(_searchStateToMetadataMapper.Map);
     view.SearchMetadataCollection.Add(searches);
     view.SearchCollection.Select(tailviewstate.SelectedSearch);
     _logger.Info("DONE: Applied {0} search settings for {1} ", tailviewstate.SearchItems.Count(), view.Name);
 }
Exemple #2
0
        public void Restore(TailViewModel view, TailViewState tailviewstate)
        {
            _logger.Info("Applying {0} saved search settings  for {1} ", tailviewstate.SearchItems.Count(), view.Name);
            var searches = tailviewstate.SearchItems.Select(_searchStateToMetadataMapper.Map);

            view.SearchMetadataCollection.Add(searches);
            view.SearchCollection.Select(tailviewstate.SelectedSearch);
            _logger.Info("DONE: Applied {0} search settings for {1} ", tailviewstate.SearchItems.Count(), view.Name);
        }
        public State CaptureState()
        {
            var searchItems = _tailView.SearchOptions
                              .Data
                              .Select(search => new SearchState
                                      (
                                          search.Text,
                                          search.UseRegex,
                                          search.Highlight,
                                          search.Filter,
                                          false,
                                          search.IgnoreCase
                                      ));

            var tailViewState = new TailViewState(_tailView.Name, _tailView.SearchCollection.Selected.Text, searchItems);
            var converter     = new TailViewToStateConverter();

            return(converter.Convert(tailViewState));
        }
Exemple #4
0
        public State Convert(string fileName, string selectedSearch, SearchMetadata[] items)
        {
            var searchItems = items
                              .OrderBy(s => s.Position)
                              .Select(search => new SearchState
                                      (
                                          search.SearchText,
                                          search.Position,
                                          search.UseRegex,
                                          search.Highlight,
                                          search.Filter,
                                          false,
                                          search.IgnoreCase,
                                          search.HighlightHue.Swatch,
                                          search.IconKind,
                                          search.HighlightHue.Name

                                      )).ToArray();

            var tailViewState = new TailViewState(fileName, selectedSearch, searchItems);
            var converter     = new TailViewToStateConverter();

            return(converter.Convert(tailViewState));
        }