Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4c5fee0

Browse files
committed
Merge pull request #117 from github/feature/pr/github-pane
GitHub pane, toolbar and menu item
2 parents 0ea5701 + 3ef9185 commit 4c5fee0

23 files changed

+527
-56
lines changed

src/GitHub.Exports/Exports/ExportMetadata.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ public enum UIViewType {
1717
Clone,
1818
Publish,
1919
End = 100,
20-
Finished
21-
}
20+
Finished,
21+
GitHubPane,
22+
}
2223

2324
[MetadataAttribute]
2425
[AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
<ItemGroup>
126126
<Compile Include="Authentication\AuthenticationResultExtensions.cs" />
127127
<Compile Include="Extensions\VSExtensions.cs" />
128+
<Compile Include="ViewModels\IServiceProviderAware.cs" />
128129
<Compile Include="UI\IView.cs" />
129130
<Compile Include="UI\Octicon.cs" />
130131
<Compile Include="ViewModels\IGitHubConnectSection.cs" />
@@ -145,6 +146,7 @@
145146
<Compile Include="Services\IUIProvider.cs" />
146147
<Compile Include="Services\IWikiProbe.cs" />
147148
<Compile Include="Services\WikiProbe.cs" />
149+
<Compile Include="ViewModels\IGitHubPaneViewModel.cs" />
148150
<Compile Include="ViewModels\ILoginViewModel.cs" />
149151
<Compile Include="Primitives\HostAddress.cs" />
150152
<Compile Include="UI\IUIController.cs" />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Windows.Input;
2+
3+
namespace GitHub.ViewModels
4+
{
5+
public interface IGitHubPaneViewModel : IViewModel
6+
{
7+
string ActiveRepoName { get; }
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System;
2+
3+
namespace GitHub.ViewModels
4+
{
5+
public interface IServiceProviderAware
6+
{
7+
void Initialize(IServiceProvider serviceProvider);
8+
}
9+
}

src/GitHub.VisualStudio/Base/TeamExplorerGitRepoInfo.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using GitHub.Models;
22
using GitHub.Primitives;
33
using GitHub.Services;
4+
using GitHub.VisualStudio.Helpers;
45
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
56
using NullGuard;
67

@@ -10,7 +11,9 @@ public class TeamExplorerGitRepoInfo : TeamExplorerBase, IGitAwareItem
1011
{
1112
public TeamExplorerGitRepoInfo()
1213
{
13-
ActiveRepo = null;
14+
activeRepo = null;
15+
activeRepoUri = null;
16+
activeRepoName = string.Empty;
1417
}
1518

1619
ISimpleRepositoryModel activeRepo;
@@ -24,14 +27,26 @@ public ISimpleRepositoryModel ActiveRepo
2427
ActiveRepoName = string.Empty;
2528
ActiveRepoUri = null;
2629
activeRepo = value;
30+
this.RaisePropertyChange();
2731
}
2832
}
2933

34+
UriString activeRepoUri;
3035
/// <summary>
3136
/// Represents the web URL of the repository on GitHub.com, even if the origin is an SSH address.
3237
/// </summary>
3338
[AllowNull]
34-
public UriString ActiveRepoUri { [return: AllowNull] get; set; }
35-
public string ActiveRepoName { get; set; }
39+
public UriString ActiveRepoUri
40+
{
41+
[return: AllowNull] get { return activeRepoUri; }
42+
set { activeRepoUri = value; this.RaisePropertyChange(); }
43+
}
44+
45+
string activeRepoName;
46+
public string ActiveRepoName
47+
{
48+
get { return activeRepoName; }
49+
set { activeRepoName = value; this.RaisePropertyChange(); }
50+
}
3651
}
3752
}

src/GitHub.VisualStudio/Base/TeamExplorerItemBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public ISimpleApiClient SimpleApiClient
3131

3232
protected ISimpleApiClientFactory ApiFactory => apiFactory;
3333

34+
public TeamExplorerItemBase(ITeamExplorerServiceHolder holder)
35+
{
36+
this.holder = holder;
37+
}
38+
3439
public TeamExplorerItemBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
3540
{
3641
this.apiFactory = apiFactory;

src/GitHub.VisualStudio/Base/TeamExplorerSectionBase.cs

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
using NullGuard;
55
using GitHub.Services;
66
using System.Diagnostics;
7-
using System.Threading;
8-
using GitHub.Extensions;
9-
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
107
using GitHub.Api;
118
using GitHub.Models;
9+
using GitHub.ViewModels;
1210

1311
namespace GitHub.VisualStudio.Base
1412
{
15-
public class TeamExplorerSectionBase : TeamExplorerItemBase, ITeamExplorerSection
13+
public class TeamExplorerSectionBase : TeamExplorerItemBase, ITeamExplorerSection, IServiceProviderAware
1614
{
1715
protected IConnectionManager connectionManager;
1816

@@ -52,6 +50,14 @@ public virtual object GetExtensibilityService(Type serviceType)
5250
return null;
5351
}
5452

53+
public TeamExplorerSectionBase(ITeamExplorerServiceHolder holder)
54+
: base(holder)
55+
{
56+
IsVisible = false;
57+
IsEnabled = true;
58+
IsExpanded = true;
59+
}
60+
5561
public TeamExplorerSectionBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder)
5662
: base(apiFactory, holder)
5763
{
@@ -60,29 +66,39 @@ public TeamExplorerSectionBase(ISimpleApiClientFactory apiFactory, ITeamExplorer
6066
IsExpanded = true;
6167
}
6268

69+
public TeamExplorerSectionBase(ITeamExplorerServiceHolder holder, IConnectionManager cm) : this(holder)
70+
{
71+
connectionManager = cm;
72+
}
73+
6374
public TeamExplorerSectionBase(ISimpleApiClientFactory apiFactory, ITeamExplorerServiceHolder holder,
6475
IConnectionManager cm) : this(apiFactory, holder)
6576
{
6677
connectionManager = cm;
6778
}
6879

69-
public virtual void Cancel()
80+
void ITeamExplorerSection.Cancel()
81+
{
82+
}
83+
84+
void ITeamExplorerSection.Initialize(object sender, SectionInitializeEventArgs e)
7085
{
86+
Initialize(e.ServiceProvider);
7187
}
7288

73-
public virtual void Initialize(object sender, SectionInitializeEventArgs e)
89+
public virtual void Initialize(IServiceProvider serviceProvider)
7490
{
7591
#if DEBUG
76-
// VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize", DateTime.Now, GetType());
92+
//VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize", DateTime.Now, GetType());
7793
#endif
78-
ServiceProvider = e.ServiceProvider;
94+
ServiceProvider = serviceProvider;
7995
Debug.Assert(holder != null, "Could not get an instance of TeamExplorerServiceHolder");
8096
if (holder == null)
8197
return;
82-
holder.ServiceProvider = e.ServiceProvider;
98+
holder.ServiceProvider = ServiceProvider;
8399
SubscribeToRepoChanges();
84100
#if DEBUG
85-
// VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize DONE", DateTime.Now, GetType());
101+
//VsOutputLogger.WriteLine("{0:HHmmssff}\t{1} Initialize DONE", DateTime.Now, GetType());
86102
#endif
87103
}
88104

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,15 @@
206206
<None Include="..\..\script\Key.snk" Condition="$(Buildtype) == 'Internal'">
207207
<Link>Key.snk</Link>
208208
</None>
209+
<Compile Include="..\common\SolutionInfo.cs">
210+
<Link>Properties\SolutionInfo.cs</Link>
211+
</Compile>
209212
<Compile Include="Base\TeamExplorerGitRepoInfo.cs" />
210213
<Compile Include="Base\TeamExplorerInvitationBase.cs" />
211214
<Compile Include="Base\TeamExplorerServiceHolder.cs" />
212215
<Compile Include="Converters\CountToVisibilityConverter.cs" />
213216
<Compile Include="Helpers\SharedDictionaryManager.cs" />
214217
<Compile Include="Properties\AssemblyInfo.cs" />
215-
<Compile Include="..\common\SolutionInfo.cs">
216-
<Link>Properties\SolutionInfo.cs</Link>
217-
</Compile>
218-
</ItemGroup>
219-
<ItemGroup>
220218
<Compile Include="Base\TeamExplorerBase.cs" />
221219
<Compile Include="Base\TeamExplorerItemBase.cs" />
222220
<Compile Include="Base\TeamExplorerNavigationItemBase.cs" />
@@ -251,6 +249,7 @@
251249
<Compile Include="TeamExplorer\Home\PulseNavigationItem.cs" />
252250
<Compile Include="TeamExplorer\Sync\GitHubPublishSection.cs" />
253251
<Compile Include="UI\DrawingExtensions.cs" />
252+
<Compile Include="UI\GitHubPane.cs" />
254253
<Compile Include="UI\Views\Controls\RepositoryCloneControl.xaml.cs">
255254
<DependentUpon>RepositoryCloneControl.xaml</DependentUpon>
256255
</Compile>
@@ -275,6 +274,9 @@
275274
<Compile Include="UI\Views\Controls\TwoFactorControl.xaml.cs">
276275
<DependentUpon>TwoFactorControl.xaml</DependentUpon>
277276
</Compile>
277+
<Compile Include="UI\Views\GitHubPaneView.xaml.cs">
278+
<DependentUpon>GitHubPaneView.xaml</DependentUpon>
279+
</Compile>
278280
<Compile Include="UI\WindowController.xaml.cs">
279281
<DependentUpon>WindowController.xaml</DependentUpon>
280282
</Compile>
@@ -318,6 +320,7 @@
318320
<ItemGroup>
319321
<VSCTCompile Include="GitHub.VisualStudio.vsct">
320322
<ResourceName>Menus.ctmenu</ResourceName>
323+
<SubType>Designer</SubType>
321324
</VSCTCompile>
322325
</ItemGroup>
323326
<ItemGroup>
@@ -333,6 +336,22 @@
333336
<Resource Include="Resources\default_user_avatar.png" />
334337
</ItemGroup>
335338
<ItemGroup>
339+
<Page Include="Resources\icons\refresh.xaml">
340+
<Generator>MSBuild:Compile</Generator>
341+
<SubType>Designer</SubType>
342+
</Page>
343+
<Page Include="Resources\icons\arrow_right.xaml">
344+
<Generator>MSBuild:Compile</Generator>
345+
<SubType>Designer</SubType>
346+
</Page>
347+
<Page Include="Resources\icons\arrow_left.xaml">
348+
<Generator>MSBuild:Compile</Generator>
349+
<SubType>Designer</SubType>
350+
</Page>
351+
<Page Include="Resources\icons\git_pull_request.xaml">
352+
<SubType>Designer</SubType>
353+
<Generator>MSBuild:Compile</Generator>
354+
</Page>
336355
<Page Include="Resources\icons\mark_github.xaml">
337356
<SubType>Designer</SubType>
338357
<Generator>MSBuild:Compile</Generator>
@@ -375,6 +394,10 @@
375394
<SubType>
376395
</SubType>
377396
</Page>
397+
<Page Include="UI\Views\GitHubPaneView.xaml">
398+
<SubType>Designer</SubType>
399+
<Generator>MSBuild:Compile</Generator>
400+
</Page>
378401
<Page Include="UI\WindowController.xaml">
379402
<Generator>MSBuild:Compile</Generator>
380403
</Page>
@@ -498,7 +521,6 @@
498521
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
499522
</ProjectReference>
500523
</ItemGroup>
501-
<ItemGroup />
502524
<PropertyGroup>
503525
<UseCodebase>true</UseCodebase>
504526
</PropertyGroup>

src/GitHub.VisualStudio/GitHub.VisualStudio.imagemanifest

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,27 @@
44
<String Name="Resources" Value="/GitHub.VisualStudio;component/Resources/icons" />
55
<Guid Name="guidImages" Value="{27841f47-070a-46d6-90be-a5cbbfc724ac}" />
66
<ID Name="logo" Value="1" />
7+
<ID Name="arrow_left" Value="2" />
8+
<ID Name="arrow_right" Value="3" />
9+
<ID Name="refresh" Value="4" />
10+
<ID Name="pullrequest" Value="5" />
711
</Symbols>
812

913
<Images>
1014
<Image Guid="$(guidImages)" ID="$(logo)">
1115
<Source Uri="$(Resources)/mark_github.xaml" />
1216
</Image>
17+
<Image Guid="$(guidImages)" ID="$(arrow_left)">
18+
<Source Uri="$(Resources)/arrow_left.xaml" />
19+
</Image>
20+
<Image Guid="$(guidImages)" ID="$(arrow_right)">
21+
<Source Uri="$(Resources)/arrow_right.xaml" />
22+
</Image>
23+
<Image Guid="$(guidImages)" ID="$(refresh)">
24+
<Source Uri="$(Resources)/refresh.xaml" />
25+
</Image>
26+
<Image Guid="$(guidImages)" ID="$(pullrequest)">
27+
<Source Uri="$(Resources)/git_pull_request.xaml" />
28+
</Image>
1329
</Images>
1430
</ImageManifest>

0 commit comments

Comments
 (0)