Exemplo n.º 1
0
        /// <summary>
        ///     Finds forefox/chrome bookmarks bar in bookmarks container
        /// </summary>
        /// <param name="root"></param>
        /// <returns></returns>
        public static IBookmarkFolder GetBookmarksBar(this BookmarkFolder root)
        {
            //PERSONAL_TOOLBAR_FOLDER
            if (root == null)
            {
                throw new ArgumentNullException("root");
            }
            var bar = root.GetAllItems <BookmarkFolder>().FirstOrDefault(f => f.Attributes != null && f.Attributes.ContainsKey("personal_toolbar_folder"));

            return(bar);
        }
Exemplo n.º 2
0
        public static int LoadNetscapeStyleBookmarkFile(string path)
        {
            Console.WriteLine("Start DataProcessor Main");

            var reader      = new BookmarksManager.NetscapeBookmarksReader();
            var inputStream = new System.IO.FileStream(
                path: path,
                mode: System.IO.FileMode.Open
                );

            BookmarksManager.BookmarkFolder readerResult = reader.Read(inputStream);
            int recordsLoaded = readerResult.Count;

            BookmarkStore.SaveBookmarkItemsForUser <IBookmarkItem>(bookmarkItems: readerResult, username: "******");

            Console.WriteLine("End DataProcessor Main.");

            return(recordsLoaded);
        }