Esempio n. 1
0
        void IRenderEvents.Render(SystemEvent e)
        {
            if (filter.Exclude(e))
            {
                return;
            }

            lock (bufferedItems)
            {
                bufferedItems.Add(CreateListViewItem(e));
            }
        }
Esempio n. 2
0
        public void IncludeIfEventProcessIdEqualToAnyProcessFilter(Int32 processId)
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                ProcessFilters = new[] { 2, 4, 8, 16 }
            };

            dynamicFilter.Update();

            Assert.False(dynamicFilter.Exclude(new SystemEvent {
                ProcessId = processId
            }));
        }
        public void IncludeIfEventProcessNameEqualToAnyApplicationFilter(String processName)
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                ApplicationFilters = new[] { "Abc", "Xyz", "123" }
            };

            dynamicFilter.Update();

            Assert.False(dynamicFilter.Exclude(new SystemEvent {
                ProcessName = processName
            }));
        }
        public void ApplicationNameFilterIsCaseSensitive(String processName)
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                ApplicationFilters = new[] { "Abc" }
            };

            dynamicFilter.Update();

            Assert.True(dynamicFilter.Exclude(new SystemEvent {
                ProcessName = processName
            }));
        }
        public void IncludeIfPositiveFilterDefinition()
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                TextFilters = new[] { FilterDefinition.ForPositiveExpression("Source", "Equal To", "Some Value") }
            };

            dynamicFilter.Update();

            Assert.False(dynamicFilter.Exclude(new SystemEvent {
                Source = "Some Value"
            }));
        }
Esempio n. 6
0
        public void ExcludeIfNegativeFilterDefinition()
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                TextFilters = new[] { FilterDefinition.ForNegativeExpression("Message", "Equal To", "Some Value") }
            };

            dynamicFilter.Update();

            Assert.True(dynamicFilter.Exclude(new SystemEvent {
                Message = "Some Value"
            }));
        }
Esempio n. 7
0
        public void IncludeIfEventLevelGreaterThanOrEqualToLevelFilter(SystemEventLevel level)
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                LevelFilter = SystemEventLevel.Warning
            };

            dynamicFilter.Update();

            Assert.False(dynamicFilter.Exclude(new SystemEvent {
                Level = level
            }));
        }
Esempio n. 8
0
        public void ExcludeIfEventLevelLessThanLevelFilter(SystemEventLevel level)
        {
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                LevelFilter = SystemEventLevel.Warning
            };

            dynamicFilter.Update();

            Assert.True(dynamicFilter.Exclude(new SystemEvent {
                Level = level
            }));
        }
        public void FiltersDefinitionsBySourceProperty()
        {
            var textFilters   = new[] { FilterDefinition.ForPositiveExpression("Source", "Equal To", "Some Value"), FilterDefinition.ForPositiveExpression("Message", "Equal To", "Another Value") };
            var dynamicFilter = new DynamicFilterExpression(StaticFilter)
            {
                TextFilters = textFilters
            };

            dynamicFilter.Update();

            Assert.False(dynamicFilter.Exclude(new SystemEvent {
                Source = "Some Value", Message = "Another Value"
            }));
        }