Exemple #1
0
 static IEnumerable <TreeNavigator> FindChildNavigators <T> (TreeNavigator navigator, T fieldValue, IDataField <T> field)
 {
     if (!navigator.MoveToChild())
     {
         yield break;
     }
     foreach (var treeNavigator in FindNavigators(fieldValue, field, navigator))
     {
         yield return(treeNavigator);
     }
     navigator.MoveToParent();
 }
Exemple #2
0
        public IEnumerable <TreeNavigator> FindNavigators <T> (T fieldValue, IDataField <T> field)
        {
            if (fieldValue == null)
            {
                return(Enumerable.Empty <TreeNavigator> ());
            }
            TreeNavigator navigator = GetFirstNode();

            if (navigator.CurrentPosition == null)
            {
                return(Enumerable.Empty <TreeNavigator> ());
            }
            return(FindNavigators(fieldValue, field, navigator));
        }
Exemple #3
0
        static bool IsNavigator <T> (TreeNavigator navigator, T fieldValue, IDataField <T> field)
        {
            T value = navigator.GetValue(field);

            return(fieldValue.Equals(value));
        }
Exemple #4
0
 static IEnumerable <TreeNavigator> FindNavigators <T> (T fieldValue, IDataField <T> field, TreeNavigator navigator)
 {
     do
     {
         if (IsNavigator(navigator, fieldValue, field))
         {
             yield return(navigator.Clone());
         }
         foreach (TreeNavigator foundChild in FindChildNavigators(navigator, fieldValue, field))
         {
             yield return(foundChild.Clone());
         }
     } while (navigator.MoveNext());
 }