Ejemplo n.º 1
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(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;
        }
Ejemplo n.º 2
0
 /// <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;
     }
 }
Ejemplo n.º 3
0
        /// <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();
            }
        }
Ejemplo n.º 4
0
        /// <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:\\";
                }
            }
        }