Пример #1
0
        public LogMessages()
        {
            ((ViewInformation)Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl
            {
                DataContext = this,
            };

            Messages = new ObservableCollection <ILogEntry>();

            PropertyChanged += PropertyChangedHandler;

            var dt = new DispatcherTimer(DispatcherPriority.Normal)
            {
                Interval = TimeSpan.FromMilliseconds(200),
            };

            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get <IFilteringService <IFilter> >();
            if (filteringService != null)
            {
                if (filteringService is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get <IExtractingService <IExtractor> >();
            if (extractingService != null)
            {
                if (extractingService is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            Preferences = ServiceLocator.Instance.Get <IUserPreferences>();
            if (Preferences != null)
            {
                if (Preferences is INotifyPropertyChanged notify)
                {
                    notify.PropertyChanged += (sender, args) =>
                    {
                        var prop = args.PropertyName;
                        switch (prop)
                        {
                        case "SelectedTimeFormatOption":
                        case "ConvertUtcTimesToLocalTimeZone":
                        case "SelectedDateOption":
                            rebuildList = true;
                            break;
                        }
                    };
                }
            }

            InitialiseToolbar();
        }
Пример #2
0
        public LogMessages()
        {
            ((ViewInformation)Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl {
                DataContext = this
            };

            Messages         = new ObservableCollection <ILogEntry>();
            PropertyChanged += PropertyChangedHandler;

            DispatcherTimer dt = new DispatcherTimer(DispatcherPriority.Normal)
            {
                Interval = TimeSpan.FromMilliseconds(200)
            };

            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get <IFilteringService <IFilter> >();
            if (filteringService != null)
            {
                var notify = filteringService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get <IExtractingService <IExtractor> >();
            if (extractingService != null)
            {
                var notify = extractingService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            InitialiseToolbar();
        }
Пример #3
0
        public LogMessages()
        {
            ((ViewInformation) Info).Description = DESCRIPTION;
            presenter = new LogMessagesControl { DataContext = this };

            Messages = new ObservableCollection<ILogEntry>();
            PropertyChanged += PropertyChangedHandler;

            DispatcherTimer dt = new DispatcherTimer(DispatcherPriority.Normal)
                                     {
                                         Interval = TimeSpan.FromMilliseconds(200)
                                     };
            dt.Tick += UpdateTick;
            dt.Start();

            filteringService = ServiceLocator.Instance.Get<IFilteringService<IFilter>>();
            if (filteringService != null)
            {
                var notify = filteringService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyFiltering();
                }
            }

            extractingService = ServiceLocator.Instance.Get<IExtractingService<IExtractor>>();
            if (extractingService != null)
            {
                var notify = extractingService as INotifyPropertyChanged;
                if (notify != null)
                {
                    notify.PropertyChanged += (sender, e) => ApplyExtracting();
                }
            }

            InitialiseToolbar();
        }