private IEnumerable <MetadataViewModelBase> FindMatchesNode(MetadataViewModelBase node, string text, DbEntityEnum mask) { if (node.Name.Contains(text) && !(node is CategoryViewModel) && mask.HasFlag(node.Type)) { yield return(node); } if (node.Children.Count != 0 && !node.HasFakeChild) { foreach (var treeViewItemViewModelBase in node.Children) { var treeViewItem = (MetadataViewModelBase)treeViewItemViewModelBase; foreach (MetadataViewModelBase res in FindMatchesNode(treeViewItem, text, mask)) { yield return(res); } } } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { targetValue = (DbEntityEnum)value; return(targetValue.HasFlag((DbEntityEnum)parameter)); }