Пример #1
0
        private void Find(PathEvaluatorControlViewModel vm, object parameter)
        {
            Results = string.Empty;
            try
            {
                var input   = JToken.Parse(Source);
                var results = input.SelectTokens(Expression);
                Results = string.Join(Environment.NewLine, results.Select(x => x.ToString()));

                ErrorMessage = Results.Any() ? null :"Nothing found.";
            }
            catch (Exception e)
            {
                ErrorMessage = $"Search failed. {e.Message}";
            }
        }
Пример #2
0
 private bool CanFind(PathEvaluatorControlViewModel vm, object parameter)
 {
     return(!string.IsNullOrWhiteSpace(vm.Source) && !string.IsNullOrWhiteSpace(vm.Expression));
 }