mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +00:00
optimize<Manager>: simplify Manager page
This commit is contained in:
parent
eac212737c
commit
dc17bb4b12
5 changed files with 162 additions and 436 deletions
|
@ -191,6 +191,27 @@ namespace SourceGit {
|
|||
|
||||
if (removedIdx >= 0) Groups.RemoveAt(removedIdx);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if given group has relations.
|
||||
/// </summary>
|
||||
/// <param name="parentId"></param>
|
||||
/// <param name="subId"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsSubGroup(string parentId, string subId) {
|
||||
if (string.IsNullOrEmpty(parentId)) return false;
|
||||
|
||||
var g = FindGroup(subId);
|
||||
if (g == null) return false;
|
||||
|
||||
g = FindGroup(g.ParentId);
|
||||
while (g != null) {
|
||||
if (g.Id == parentId) return true;
|
||||
g = FindGroup(g.ParentId);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region METHODS_ON_REPOS
|
||||
|
@ -209,7 +230,6 @@ namespace SourceGit {
|
|||
Path = dir.FullName,
|
||||
Name = dir.Name,
|
||||
GroupId = groupId,
|
||||
LastOpenTime = 0,
|
||||
};
|
||||
|
||||
Repositories.Add(repo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue