This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed
src/GitHub.VisualStudio.16/Sync Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -127,22 +127,16 @@ void Section_PropertyChanged(object sender, PropertyChangedEventArgs e)
127127
128128 void RefreshVisibility ( )
129129 {
130- var visible = false ;
131-
132- if ( ServiceProvider . GetService ( typeof ( ITeamExplorerPage ) ) is ITeamExplorerPage page )
133- {
134- visible = IsSectionVisible ( page , PushToRemoteSectionId ) ;
135- }
136-
137- if ( IsVisible != visible )
130+ var isVisible = IsSectionVisible ( PushToRemoteSectionId ) ;
131+ if ( IsVisible != isVisible )
138132 {
139- if ( visible )
133+ if ( isVisible )
140134 {
141- // Don't initialize the view until it becomes visible
135+ // Initialize the view when it becomes visible
142136 EnsureSectionInitialized ( ) ;
143137 }
144138
145- IsVisible = visible ;
139+ IsVisible = isVisible ;
146140 }
147141 }
148142
@@ -162,14 +156,10 @@ void EnsureSectionInitialized()
162156 }
163157 }
164158
165- bool IsSectionVisible ( ITeamExplorerPage teamExplorerPage , Guid sectionId )
166- {
167- if ( teamExplorerPage . GetSection ( sectionId ) is ITeamExplorerSection pushToRemoteSection )
168- {
169- return pushToRemoteSection . SectionContent != null && pushToRemoteSection . IsVisible ;
170- }
171-
172- return false ;
173- }
159+ bool IsSectionVisible ( Guid sectionId ) =>
160+ ServiceProvider . GetService ( typeof ( ITeamExplorerPage ) ) is ITeamExplorerPage page &&
161+ page . GetSection ( sectionId ) is ITeamExplorerSection section &&
162+ section . SectionContent != null &&
163+ section . IsVisible ;
174164 }
175165}
You can’t perform that action at this time.
0 commit comments