/// <summary> /// Method is invoked when the user clicks the drop down and has selected an item. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BookmarkedLocations_RequestChangeOfDirectory(object sender, BrowsingEventArgs e) { if (e.IsBrowsing == false && e.Result == BrowseResult.Complete) { this.Path = e.Location.Path; } }
/// <summary> /// One of the controls has changed its location in its space. /// This method is invoked to synchronize this change with all other controls. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Control_BrowseEvent(object sender, BrowsingEventArgs e) { var location = e.Location; //// SelectedFolder = location.Path; //// //// if (e.IsBrowsing == false && e.Result == BrowseResult.Complete) //// { //// // XXX Todo Keep task reference, support cancel, and remove on end? //// try //// { //// var timeout = TimeSpan.FromSeconds(5); //// var actualTask = new Task(() => //// { //// var request = new BrowseRequest(location, _CancelTokenSourc.Token); //// //// var t = Task.Factory.StartNew(() => NavigateToFolderAsync(request, sender), //// request.CancelTok, //// TaskCreationOptions.LongRunning, //// _OneTaskScheduler); //// //// if (t.Wait(timeout) == true) //// return; //// //// _CancelTokenSourc.Cancel(); // Task timed out so lets abort it //// return; // Signal timeout here... //// }); //// //// actualTask.Start(); //// actualTask.Wait(); //// } //// catch (System.AggregateException ex) //// { //// Logger.Error(ex); //// } //// catch (Exception ex) //// { //// Logger.Error(ex); //// } //// } //// else //// { //// if (e.IsBrowsing == true) //// { //// // The sender has messaged: "I am changing location..." //// // So, we set this property to tell the others: //// // 1) Don't change your location now (eg.: Disable UI) //// // 2) We'll be back to tell you the location when we know it //// if (TreeBrowser != sender) //// TreeBrowser.SetExternalBrowsingState(true); //// //// if (FolderTextPath != sender) //// FolderTextPath.SetExternalBrowsingState(true); //// //// if (FolderItemsView != sender) //// FolderItemsView.SetExternalBrowsingState(true); //// } //// } }
private void RecentLocations_RequestChangeOfDirectory(object sender, BrowsingEventArgs e) { if (e.IsBrowsing == false && e.Result == BrowseResult.Complete) { // XXX Todo Keep task reference, support cancel, and remove on end? var t = TreeBrowser.NavigateToAsync(new BrowseRequest(e.Location)); } }