public WindowsEventLogPoller(string logName, ITelemetrySender sender, IBookmarker bookmarker)
        {
            Guard.IsNotNullOrEmpty(nameof(logName), logName);
            Guard.IsNotNull(nameof(sender), sender);

            this.sender     = sender;
            this.logName    = logName;
            this.bookmarker = bookmarker;

            watcher = new EventLogWatcher(new EventLogQuery(logName, PathType.LogName, "*"), this.bookmarker.GetLatest(BookmarkName), true);
            watcher.EventRecordWritten += OnEventRecordWritten;
        }
Пример #2
0
        public BookmarkAction(Browser browser)
            : base("Bookmark", "_Bookmark")
        {
            this.browser = browser;

            IconSet bookmark_iconset = new IconSet();
            IconSource bookmark_iconsource = new IconSource();
            bookmark_iconsource.IconName = "bookmark-new";
            bookmark_iconset.AddSource(bookmark_iconsource);
            browser.factory.Add("summa-bookmark-new", bookmark_iconset);

            Tooltip = "Bookmark this item";
            StockId = "summa-bookmark-new";
            Activated += Bookmark;

            switch(Config.Bookmarker) {
                case "Native":
                    bookmarker = new NativeBookmarker();
                    break;
                case "Dieu":
                    bookmarker = new DieuBookmarker();
                    break;
            }
        }