/// <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(IBookmarkedLocationsViewModel recentLocations) { if (this.BookmarkedLocations != null) { this.BookmarkedLocations.RequestChangeOfDirectory -= RecentLocations_RequestChangeOfDirectory; if (TreeBrowser != null) { 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 this.BookmarkedLocations = recentLocations.Copy(); } else { this.BookmarkedLocations = FolderBrowser.FolderBrowserFactory.CreateReceentLocationsViewModel(); } if (this.BookmarkedLocations != null) { this.BookmarkedLocations.RequestChangeOfDirectory += RecentLocations_RequestChangeOfDirectory; } TreeBrowser.BookmarkFolder.RequestEditBookmarkedFolders += BookmarkFolder_RequestEditBookmarkedFolders; }
/// <summary> /// Method is invoked when drop element is closed. /// </summary> /// <param name="bookmarks"></param> /// <param name="selectedPath"></param> /// <param name="result"></param> private void DropDownClosedResult(IBookmarkedLocationsViewModel bookmarks, string selectedPath, FolderBrowser.Dialogs.Interfaces.Result result) { if (result == FolderBrowser.Dialogs.Interfaces.Result.OK) { this.BookmarkedLocations = bookmarks.Copy(); this.BookmarkSelected = selectedPath; } }
/// <summary> /// Class constructor /// </summary> /// <param name="initialPath"></param> /// <param name="bookmarks"></param> /// <param name="specialFolderVisibility"></param> public FolderBrowserControler(string initialPath , IBookmarkedLocationsViewModel bookmarks , bool specialFolderVisibility = true) : this() { _SpecialFolderVisibility = specialFolderVisibility; _InitialPath = initialPath; if (bookmarks != null) { _FBB_Bookmarks = bookmarks.Copy(); } }
/// <summary> /// Method is invoked when drop element is closed. /// </summary> /// <param name="bookmarks"></param> /// <param name="selectedPath"></param> /// <param name="result"></param> private void DropDownClosedResult(IBookmarkedLocationsViewModel bookmarks, string selectedPath, FolderBrowser.Dialogs.Interfaces.Result result) { if (result == FolderBrowser.Dialogs.Interfaces.Result.OK) { this.BookmarkedLocations = bookmarks.Copy(); this.NewSolutionLocation = selectedPath; var optGroup = GetService <ISettingsManager>().Options.GetOptionGroup("Options"); EditBookmarksViewModel.SaveBookmarksToModel(BookmarkedLocations.DropDownItems, optGroup); } }
/// <summary> /// Method is invoked when drop element is closed. /// </summary> /// <param name="bookmarks"></param> /// <param name="selectedPath"></param> /// <param name="result"></param> private void DropDownClosedResult(IBookmarkedLocationsViewModel bookmarks, string selectedPath, FolderBrowser.Dialogs.Interfaces.Result result) { if (result == FolderBrowser.Dialogs.Interfaces.Result.OK) { if (bookmarks != null) { this.BookmarkedLocations = bookmarks.Copy(); } if (string.IsNullOrEmpty(selectedPath) == false) { this.InitialPath = selectedPath; } else { this.InitialPath = @"C:\\"; } } }