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

Commit 5f061c5

Browse files
author
Meaghan Lewis
authored
Merge branch 'master' into bump-version
2 parents 0e2779d + 95e983b commit 5f061c5

File tree

10 files changed

+32
-19
lines changed

10 files changed

+32
-19
lines changed

docs/developer/how-viewmodels-are-turned-into-views.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ This is the basis for converting view models to views.
6565

6666
There are currently two top-level controls for our UI:
6767

68-
- [GitHubDialogWindow](../src/GitHub.VisualStudio/Views/Dialog/GitHubDialogWindow.xaml) for the dialog which shows the login, clone, etc views
69-
- [GitHubPaneView](../src/GitHub.VisualStudio/Views/GitHubPane/GitHubPaneView.xaml) for the GitHub pane
68+
- [GitHubDialogWindow](../../src/GitHub.VisualStudio/Views/Dialog/GitHubDialogWindow.xaml) for the dialog which shows the login, clone, etc views
69+
- [GitHubPaneView](../../src/GitHub.VisualStudio/Views/GitHubPane/GitHubPaneView.xaml) for the GitHub pane
7070

7171
In the resources for each of these top-level controls we define a `DataTemplate` like so:
7272

@@ -77,10 +77,10 @@ In the resources for each of these top-level controls we define a `DataTemplate`
7777
</DataTemplate>
7878
```
7979

80-
The `DataTemplate.DataType` here applies the template to all classes inherited from [`GitHub.ViewModels.ViewModelBase`](../src/GitHub.Exports.Reactive/ViewModels/ViewModelBase.cs) [1]. The template defines a single `ContentControl` whose contents are created by a `ViewLocator`.
80+
The `DataTemplate.DataType` here applies the template to all classes inherited from [`GitHub.ViewModels.ViewModelBase`](../../src/GitHub.Exports.Reactive/ViewModels/ViewModelBase.cs) [1]. The template defines a single `ContentControl` whose contents are created by a `ViewLocator`.
8181

82-
The [`ViewLocator`](../src/GitHub.VisualStudio/Views/ViewLocator.cs) class is an `IValueConverter` which then creates an instance of the appropriate view for the view model using MEF.
82+
The [`ViewLocator`](../../src/GitHub.VisualStudio/Views/ViewLocator.cs) class is an `IValueConverter` which then creates an instance of the appropriate view for the view model using MEF.
8383

8484
And thus a view model becomes a view.
8585

86-
[1]: it would be nice to make it apply to all classes that inherit `IViewModel` but unfortunately WPF's `DataTemplate`s don't work with interfaces.
86+
[1]: it would be nice to make it apply to all classes that inherit `IViewModel` but unfortunately WPF's `DataTemplate`s don't work with interfaces.

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
<Compile Include="Services\IUsageService.cs" />
198198
<Compile Include="Settings\PkgCmdID.cs" />
199199
<Compile Include="ViewModels\GitHubPane\IGitHubPaneViewModel.cs" />
200+
<Compile Include="ViewModels\GitHubPane\IGitHubToolWindowManager.cs" />
200201
<Compile Include="ViewModels\IConnectionInitializedViewModel.cs" />
201202
<Compile Include="ViewModels\IInfoPanel.cs" />
202203
<Compile Include="ViewModels\IViewModel.cs" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
using System.Runtime.InteropServices;
4+
5+
namespace GitHub.ViewModels.GitHubPane
6+
{
7+
/// <summary>
8+
/// The Visual Studio service interface for accessing the GitHub Pane.
9+
/// </summary>
10+
[Guid("FC9EC5B5-C297-4548-A229-F8E16365543C")]
11+
[ComVisible(true)]
12+
public interface IGitHubToolWindowManager
13+
{
14+
/// <summary>
15+
/// Ensure that the GitHub pane is created and visible.
16+
/// </summary>
17+
/// <returns>The view model for the GitHub Pane.</returns>
18+
Task<IGitHubPaneViewModel> ShowGitHubPane();
19+
}
20+
}

src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.IO;
3-
using System.Windows;
43
using System.Threading.Tasks;
54
using System.ComponentModel.Composition;
65
using GitHub.Commands;
76
using GitHub.Services;
7+
using GitHub.ViewModels.GitHubPane;
88
using GitHub.Services.Vssdk.Commands;
99
using EnvDTE;
1010
using Microsoft.VisualStudio;

src/GitHub.VisualStudio/Commands/OpenPullRequestsCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using GitHub.Commands;
55
using GitHub.Logging;
66
using GitHub.Services;
7+
using GitHub.ViewModels.GitHubPane;
78
using GitHub.Services.Vssdk.Commands;
89
using Serilog;
910

src/GitHub.VisualStudio/Commands/ShowCurrentPullRequestCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using GitHub.Commands;
55
using GitHub.Logging;
66
using GitHub.Services;
7-
using GitHub.Extensions;
7+
using GitHub.ViewModels.GitHubPane;
88
using GitHub.Services.Vssdk.Commands;
99
using Serilog;
1010

src/GitHub.VisualStudio/Commands/ShowGitHubPaneCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using GitHub.Commands;
55
using GitHub.Logging;
66
using GitHub.Services;
7+
using GitHub.ViewModels.GitHubPane;
78
using GitHub.Services.Vssdk.Commands;
89
using Serilog;
910

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
using System;
2-
using System.Runtime.InteropServices;
3-
using System.Threading.Tasks;
4-
using GitHub.ViewModels.GitHubPane;
52

63
namespace GitHub.VisualStudio
74
{
85
public interface IServiceProviderPackage : IServiceProvider, Microsoft.VisualStudio.Shell.IAsyncServiceProvider
96
{
107
}
11-
12-
[Guid("FC9EC5B5-C297-4548-A229-F8E16365543C")]
13-
[ComVisible(true)]
14-
public interface IGitHubToolWindowManager
15-
{
16-
Task<IGitHubPaneViewModel> ShowGitHubPane();
17-
}
188
}

src/GitHub.VisualStudio/Views/Dialog/ForkRepositoryExecuteView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<ColumnDefinition Width="*" />
5555
</Grid.ColumnDefinitions>
5656

57-
<ui:OcticonImage Grid.Column="0" Icon="repo_forked" Background="Red" Height="16" Width="16" />
57+
<ui:OcticonImage Grid.Column="0" Icon="repo_forked" Height="16" Width="16" />
5858
<TextBlock Margin="8 0 0 0" Grid.Column="1" TextWrapping="Wrap">Fork the repository</TextBlock>
5959
</Grid>
6060

test/GitHub.InlineReviews.UnitTests/Services/PullRequestSessionManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ Line 2
555555
}
556556
}
557557

558-
[Test]
558+
[Test, Ignore("Flaky test, see https://github.com/github/VisualStudio/issues/1795")]
559559
public async Task AddsNewReviewCommentToThread()
560560
{
561561
var baseContents = @"Line 1

0 commit comments

Comments
 (0)