コード例 #1
0
        public void StringFilterContainsTest()
        {
            var filter = new StringFilter(telemetry => telemetry.DocumentationCommentId, "SomeMethod")
            {
                FilterKind = FilterKind.Contains
            };
            var newList = filter.ApplyFilter(_testlist);

            Assert.IsNotNull(newList);
            Assert.AreEqual(1, newList.Count);
            Assert.AreEqual("SomeMethodHere", newList.First().DocumentationCommentId);
        }
コード例 #2
0
        public void StringFilterEqualsTest()
        {
            var filter = new StringFilter(telemetry => telemetry.DocumentationCommentId, "SomeDocumentateionCommentId2")
            {
                FilterKind = FilterKind.IsEqual
            };
            var newList = filter.ApplyFilter(_testlist);

            Assert.IsNotNull(newList);
            Assert.AreEqual(1, newList.Count);
            Assert.AreEqual("SomeDocumentateionCommentId2", newList.First().DocumentationCommentId);
        }
コード例 #3
0
 private void StartSearching()
 {
     {
         var          values       = textBoxSearch.Text.Split(' ');
         StringFilter filteredList = new StringFilter("||", values);
         this.displayedList = filteredList.ApplyFilter(eventsList);
         if (this.displayedList.Length > 0)
         {
             listView1.Items.Clear();
             this.displayedList.Sort();
             foreach (Event ev in this.displayedList)
             {
                 AddAppointmentToListView(ev);
             }
             labelFiltered.Visible   = true;
             linkLabel_Clear.Visible = true;
             listView1.Refresh();
         }
         else
         {
             MessageBox.Show(string.Format("No records matching the current criteria were found!"), "No records found", MessageBoxButtons.OK);
         }
     }
 }