mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
style<Dashboard>: code style - nest class when it's only used by outer class
This commit is contained in:
parent
4ee9234289
commit
8a4dee918d
2 changed files with 26 additions and 26 deletions
|
@ -302,7 +302,7 @@
|
|||
</TreeView.ItemContainerStyle>
|
||||
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:RemoteNode}" ItemsSource="{Binding Children}">
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:Dashboard+RemoteNode}" ItemsSource="{Binding Children}">
|
||||
<Grid Height="24">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="16"/>
|
||||
|
@ -314,7 +314,7 @@
|
|||
</Grid>
|
||||
</HierarchicalDataTemplate>
|
||||
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:BranchNode}" ItemsSource="{Binding Children}">
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:Dashboard+BranchNode}" ItemsSource="{Binding Children}">
|
||||
<Grid Height="24">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="16"/>
|
||||
|
|
|
@ -13,30 +13,6 @@ using System.Windows.Threading;
|
|||
|
||||
namespace SourceGit.UI {
|
||||
|
||||
/// <summary>
|
||||
/// Branch node in tree.
|
||||
/// </summary>
|
||||
public class BranchNode {
|
||||
public string Name { get; set; }
|
||||
public Git.Branch Branch { get; set; }
|
||||
public bool IsExpanded { get; set; }
|
||||
public bool IsCurrent => Branch != null ? Branch.IsCurrent : false;
|
||||
public bool IsFiltered => Branch != null ? Branch.IsFiltered : false;
|
||||
public string Track => Branch != null ? Branch.UpstreamTrack : "";
|
||||
public Visibility FilterVisibility => Branch == null ? Visibility.Collapsed : Visibility.Visible;
|
||||
public Visibility TrackVisibility => (Branch != null && !Branch.IsSameWithUpstream) ? Visibility.Visible : Visibility.Collapsed;
|
||||
public List<BranchNode> Children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remote node in tree.
|
||||
/// </summary>
|
||||
public class RemoteNode {
|
||||
public string Name { get; set; }
|
||||
public bool IsExpanded { get; set; }
|
||||
public List<BranchNode> Children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dashboard for opened repository.
|
||||
/// </summary>
|
||||
|
@ -46,6 +22,30 @@ namespace SourceGit.UI {
|
|||
private List<RemoteNode> cachedRemotes = new List<RemoteNode>();
|
||||
private string abortCommand = null;
|
||||
|
||||
/// <summary>
|
||||
/// Branch node in tree.
|
||||
/// </summary>
|
||||
public class BranchNode {
|
||||
public string Name { get; set; }
|
||||
public Git.Branch Branch { get; set; }
|
||||
public bool IsExpanded { get; set; }
|
||||
public bool IsCurrent => Branch != null ? Branch.IsCurrent : false;
|
||||
public bool IsFiltered => Branch != null ? Branch.IsFiltered : false;
|
||||
public string Track => Branch != null ? Branch.UpstreamTrack : "";
|
||||
public Visibility FilterVisibility => Branch == null ? Visibility.Collapsed : Visibility.Visible;
|
||||
public Visibility TrackVisibility => (Branch != null && !Branch.IsSameWithUpstream) ? Visibility.Visible : Visibility.Collapsed;
|
||||
public List<BranchNode> Children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remote node in tree.
|
||||
/// </summary>
|
||||
public class RemoteNode {
|
||||
public string Name { get; set; }
|
||||
public bool IsExpanded { get; set; }
|
||||
public List<BranchNode> Children { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Expand/Collapsed tags
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in a new issue