mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
feature<PageTabBar>: add context menu to close tabs and modify bookmarks
This commit is contained in:
parent
232c209079
commit
602f934fae
6 changed files with 107 additions and 1 deletions
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
@ -368,6 +369,21 @@ namespace SourceGit.Views.Widgets {
|
|||
var repo = Models.Preference.Instance.AddRepository(root, gitDir, "");
|
||||
Models.Watcher.Open(repo);
|
||||
}
|
||||
|
||||
public void UpdateNodes(string id, int bookmark, IEnumerable<Node> nodes = null) {
|
||||
if (nodes == null) nodes = tree.ItemsSource.OfType<Node>();
|
||||
foreach (var node in nodes) {
|
||||
if (!node.IsGroup) {
|
||||
if (node.Id == id) {
|
||||
node.Bookmark = bookmark;
|
||||
break;
|
||||
}
|
||||
} else if (node.Children.Count > 0) {
|
||||
UpdateNodes(id, bookmark, node.Children);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RENAME_NODES
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue