Beispiel #1
0
        /// <summary>
        /// Method is invoked to copy the given bookmarks into the local
        /// bookmark locations object (typically called up close of browser dialog).
        /// </summary>
        /// <param name="bookmarkedLocations"></param>
        private void CloneBookMarks(IBookmarksViewModel bookmarkedLocations)
        {
            if (bookmarkedLocations == null)
            {
                return;
            }

            this.BookmarkedLocations = bookmarkedLocations.CloneBookmark();
        }
Beispiel #2
0
        /// <summary>
        /// Method is invoked to copy the given bookmarks into the local
        /// bookmark locations object (typically called up close of browser dialog).
        /// </summary>
        /// <param name="bookmarkedLocations"></param>
        private void CloneBookMarks(IBookmarksViewModel bookmarkedLocations)
        {
            if (bookmarkedLocations == null)
            {
                return;
            }

            BookmarkedLocations.BrowseEvent -= BookmarkedLocations_RequestChangeOfDirectory;

            this.BookmarkedLocations = bookmarkedLocations.CloneBookmark();

            BookmarkedLocations.BrowseEvent += BookmarkedLocations_RequestChangeOfDirectory;
        }
Beispiel #3
0
        /// <summary>
        /// (Re-)Connects the Bookmark ViewModel with the
        /// <seealso cref="IBrowserViewModel"/>.BrowsePath(string, bool) method via private method.
        /// to enable user's path selection being input to folder browser.
        /// </summary>
        /// <param name="recentLocations"></param>
        protected void ResetBookmarks(IBookmarksViewModel recentLocations)
        {
            if (BookmarkedLocations != null)
            {
                //BookmarkedLocations.BrowseEvent -= RecentLocations_RequestChangeOfDirectory;
                WeakEventManager <ICanNavigate, BrowsingEventArgs>
                .RemoveHandler(BookmarkedLocations, "BrowseEvent", RecentLocations_RequestChangeOfDirectory);

                if (TreeBrowser != null)
                {
                    //TreeBrowser.BookmarkFolder.RequestEditBookmarkedFolders -= BookmarkFolder_RequestEditBookmarkedFolders;
                    WeakEventManager <IEditBookmarks, EditBookmarkEvent>
                    .RemoveHandler(TreeBrowser.BookmarkFolder, "RequestEditBookmarkedFolders", BookmarkFolder_RequestEditBookmarkedFolders);
                }
            }

            if (recentLocations != null)
            {
                // The recentlocations drop down is optionanl
                // Its component and add/remove context menu accessibility in the treeview
                // is only shown if caller supplied this object
                BookmarkedLocations = recentLocations.CloneBookmark();
            }
            else
            {
                BookmarkedLocations = FileSystemModels.Factory.CreateBookmarksViewModel();
            }

            if (BookmarkedLocations != null)
            {
                //BookmarkedLocations.BrowseEvent += RecentLocations_RequestChangeOfDirectory;
                WeakEventManager <ICanNavigate, BrowsingEventArgs>
                .AddHandler(BookmarkedLocations, "BrowseEvent", RecentLocations_RequestChangeOfDirectory);
            }

            //TreeBrowser.BookmarkFolder.RequestEditBookmarkedFolders += BookmarkFolder_RequestEditBookmarkedFolders;
            WeakEventManager <IEditBookmarks, EditBookmarkEvent>
            .AddHandler(TreeBrowser.BookmarkFolder, "RequestEditBookmarkedFolders", BookmarkFolder_RequestEditBookmarkedFolders);
        }