Ejemplo n.º 1
0
 private bool NodePassFiltering(Node node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     return(node.Get <StringInterpreter>() != null &&
            FilteringUtils.PassFiltering(node.Get <StringInterpreter>().Value.ToUpper(), FilterTokens));
 }
Ejemplo n.º 2
0
        public static void _Main(string[] args)
        {
            var result = FilteringUtils.Search("S");     // insert here which letter is to be searched

            Console.WriteLine(result);

            var startingString = "Monte Falco, 1658, Parco Foreste Casentinesi ; Monte Falterona, 1654, Parco Foreste Casentinesi; Monte Fumaiolo, 1407, Appennino Tosco Emiliano";
            var result2        = Mountains.ListOfMountains(startingString); // less code here, only methods

            foreach (var item in result2)
            {
                Console.WriteLine(item.Split(',')[0].Trim());
            }
        }
        private void RefreshList()
        {
            var tokens = _searchControl.UpperKeyTokens;

            listBox1.BeginUpdate();
            listBox1.Items.Clear();
            foreach (var child in _document.Root.Children)
            {
                var data = new ItemData(child.Value);
                if (FilteringUtils.PassFiltering(data.Builder.ShapeName.ToUpper(), tokens))
                {
                    listBox1.Items.Add(data);
                }
            }
            listBox1.EndUpdate();
        }
        public void PopulateControl(StackPanel mainGrid, IEnumerable <string> filterCriterias)
        {
            GeneratedProperties.Clear();

            foreach (var property in
                     _propertyList.Where(property => FilteringUtils.PassFilteringInsensitive(property.Name, filterCriterias))
                     )
            {
                GeneratedProperties.Add(property);
                var rowGridPanel = new DockPanel {
                    HorizontalAlignment = HorizontalAlignment.Stretch
                };
                var label = new Label
                {
                    Content             = property.Name,
                    Margin              = new Thickness(7, 0, 0, 0),
                    Width               = 90,
                    HorizontalAlignment = HorizontalAlignment.Left
                };
                rowGridPanel.Children.Add(label);
                mainGrid.Children.Add(rowGridPanel);
                property.FillControlEvents(rowGridPanel);
            }
        }