Example #1
0
        public Main()
        {
            _storage  = new PluginJsonStorage <Settings>();
            _settings = _storage.Load();

            //TODO: Let the user select which browser's bookmarks are displayed
            var chromeBookmarks = new ChromeBookmarks().GetBookmarks().Distinct().ToList();

            lock (_updateLock)
            {
                cachedBookmarks = chromeBookmarks;
            }

            Task.Run(() =>
            {
                // firefox bookmarks is slow, since it nened open sqlite connection.
                // use lazy load
                var mozBookmarks = new FirefoxBookmarks().GetBookmarks();
                var cached       = mozBookmarks.Concat(cachedBookmarks).Distinct().ToList();
                lock (_updateLock)
                {
                    cachedBookmarks = cached;
                }
            });
        }
        public void Init(PluginInitContext context)
        {
            this.context = context;

            // Cache all bookmarks
            var chromeBookmarks = new ChromeBookmarks();
            var mozBookmarks    = new FirefoxBookmarks();

            //TODO: Let the user select which browser's bookmarks are displayed
            // Add Firefox bookmarks
            cachedBookmarks.AddRange(mozBookmarks.GetBookmarks());
            // Add Chrome bookmarks
            cachedBookmarks.AddRange(chromeBookmarks.GetBookmarks());

            cachedBookmarks = cachedBookmarks.Distinct().ToList();
        }
Example #3
0
        public void Init(PluginInitContext context)
        {
            this.context = context;

            // Cache all bookmarks
            var chromeBookmarks = new ChromeBookmarks();
            var mozBookmarks = new FirefoxBookmarks();

            //TODO: Let the user select which browser's bookmarks are displayed
            // Add Firefox bookmarks
            cachedBookmarks.AddRange(mozBookmarks.GetBookmarks());
            // Add Chrome bookmarks
            cachedBookmarks.AddRange(chromeBookmarks.GetBookmarks());

            cachedBookmarks = cachedBookmarks.Distinct().ToList();
        }
Example #4
0
        public void ReloadData()
        {
            //TODO: Let the user select which browser's bookmarks are displayed
            var chromeBookmarks = new ChromeBookmarks();
            var mozBookmarks    = new FirefoxBookmarks();
            var b1 = mozBookmarks.GetBookmarks();
            var b2 = chromeBookmarks.GetBookmarks();

            b1.AddRange(b2);
            var cached = b1.Distinct().ToList();

            lock (_updateLock)
            {
                cachedBookmarks = cached;
            }
        }