@@ -35,52 +35,6 @@ public override void InitializeView(IView parent)
35
35
tree . InitializeView ( this ) ;
36
36
}
37
37
38
- private void RepositoryOnStatusChanged ( CacheUpdateEvent cacheUpdateEvent )
39
- {
40
- if ( ! lastStatusChangedEvent . Equals ( cacheUpdateEvent ) )
41
- {
42
- new ActionTask ( TaskManager . Token , ( ) =>
43
- {
44
- lastStatusChangedEvent = cacheUpdateEvent ;
45
- currentStatusHasUpdate = true ;
46
- Redraw ( ) ;
47
- } )
48
- { Affinity = TaskAffinity . UI } . Start ( ) ;
49
- }
50
- }
51
-
52
- private void RepositoryOnCurrentBranchChanged ( CacheUpdateEvent cacheUpdateEvent )
53
- {
54
- if ( ! lastCurrentBranchChangedEvent . Equals ( cacheUpdateEvent ) )
55
- {
56
- new ActionTask ( TaskManager . Token , ( ) =>
57
- {
58
- lastCurrentBranchChangedEvent = cacheUpdateEvent ;
59
- currentBranchHasUpdate = true ;
60
- Redraw ( ) ;
61
- } )
62
- { Affinity = TaskAffinity . UI } . Start ( ) ;
63
- }
64
- }
65
-
66
- private void AttachHandlers ( IRepository repository )
67
- {
68
- if ( repository == null )
69
- return ;
70
-
71
- repository . CurrentBranchChanged += RepositoryOnCurrentBranchChanged ;
72
- repository . StatusChanged += RepositoryOnStatusChanged ;
73
- }
74
-
75
- private void DetachHandlers ( IRepository repository )
76
- {
77
- if ( repository == null )
78
- return ;
79
-
80
- repository . CurrentBranchChanged -= RepositoryOnCurrentBranchChanged ;
81
- repository . StatusChanged -= RepositoryOnStatusChanged ;
82
- }
83
-
84
38
public override void OnEnable ( )
85
39
{
86
40
base . OnEnable ( ) ;
@@ -106,22 +60,6 @@ public override void OnDataUpdate()
106
60
MaybeUpdateData ( ) ;
107
61
}
108
62
109
- private void MaybeUpdateData ( )
110
- {
111
- if ( currentBranchHasUpdate )
112
- {
113
- currentBranchHasUpdate = false ;
114
- currentBranch = string . Format ( "[{0}]" , Repository . CurrentBranchName ) ;
115
- }
116
-
117
- if ( currentStatusHasUpdate )
118
- {
119
- currentStatusHasUpdate = false ;
120
- var gitStatus = Repository . CurrentStatus ;
121
- tree . UpdateEntries ( gitStatus . Entries . Where ( x => x . Status != GitFileStatus . Ignored ) . ToList ( ) ) ;
122
- }
123
- }
124
-
125
63
public override void OnGUI ( )
126
64
{
127
65
GUILayout . BeginHorizontal ( ) ;
@@ -160,11 +98,72 @@ public override void OnGUI()
160
98
GUILayout . EndHorizontal ( ) ;
161
99
GUILayout . EndScrollView ( ) ;
162
100
163
-
164
101
// Do the commit details area
165
102
OnCommitDetailsAreaGUI ( ) ;
166
103
}
167
104
105
+ private void RepositoryOnStatusChanged ( CacheUpdateEvent cacheUpdateEvent )
106
+ {
107
+ if ( ! lastStatusChangedEvent . Equals ( cacheUpdateEvent ) )
108
+ {
109
+ new ActionTask ( TaskManager . Token , ( ) => {
110
+ lastStatusChangedEvent = cacheUpdateEvent ;
111
+ currentStatusHasUpdate = true ;
112
+ Redraw ( ) ;
113
+ } ) { Affinity = TaskAffinity . UI } . Start ( ) ;
114
+ }
115
+ }
116
+
117
+ private void RepositoryOnCurrentBranchChanged ( CacheUpdateEvent cacheUpdateEvent )
118
+ {
119
+ if ( ! lastCurrentBranchChangedEvent . Equals ( cacheUpdateEvent ) )
120
+ {
121
+ new ActionTask ( TaskManager . Token , ( ) => {
122
+ lastCurrentBranchChangedEvent = cacheUpdateEvent ;
123
+ currentBranchHasUpdate = true ;
124
+ Redraw ( ) ;
125
+ } ) { Affinity = TaskAffinity . UI } . Start ( ) ;
126
+ }
127
+ }
128
+
129
+ private void AttachHandlers ( IRepository repository )
130
+ {
131
+ if ( repository == null )
132
+ {
133
+ return ;
134
+ }
135
+
136
+ repository . CurrentBranchChanged += RepositoryOnCurrentBranchChanged ;
137
+ repository . StatusChanged += RepositoryOnStatusChanged ;
138
+ }
139
+
140
+ private void DetachHandlers ( IRepository repository )
141
+ {
142
+ if ( repository == null )
143
+ {
144
+ return ;
145
+ }
146
+
147
+ repository . CurrentBranchChanged -= RepositoryOnCurrentBranchChanged ;
148
+ repository . StatusChanged -= RepositoryOnStatusChanged ;
149
+ }
150
+
151
+ private void MaybeUpdateData ( )
152
+ {
153
+ if ( currentBranchHasUpdate )
154
+ {
155
+ currentBranchHasUpdate = false ;
156
+ currentBranch = string . Format ( "[{0}]" , Repository . CurrentBranchName ) ;
157
+ }
158
+
159
+ if ( currentStatusHasUpdate )
160
+ {
161
+ currentStatusHasUpdate = false ;
162
+ var gitStatus = Repository . CurrentStatus ;
163
+ tree . UpdateEntries ( gitStatus . Entries . Where ( x => x . Status != GitFileStatus . Ignored ) . ToList ( ) ) ;
164
+ }
165
+ }
166
+
168
167
private void OnCommitDetailsAreaGUI ( )
169
168
{
170
169
GUILayout . BeginHorizontal ( ) ;
0 commit comments