Repository navigation
Expand file tree
/
Copy pathRepositoryFeedViewModel.cs
More file actions
134 lines (118 loc) · 4.92 KB
/
Copy pathRepositoryFeedViewModel.cs
File metadata and controls
134 lines (118 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Copyright (c) ReactiveUI and Contributors. All rights reserved.
// ReactiveUI and Contributors licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
using ReactiveUI.Binding.Documentation.Infrastructure;
namespace ReactiveUI.Binding.Documentation.Observing;
/// <summary>
/// The activity feed of the selected repository. Each property holds the stream of one kind of activity, and every
/// property is replaced when the user selects another repository.
/// </summary>
[System.Diagnostics.DebuggerDisplay("RepositoryFeedViewModel")]
public sealed class RepositoryFeedViewModel : ObservableObject
{
/// <summary>Gets the stream of newly opened issues, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? IssueOpened
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of closed issues, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? IssueClosed
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of reopened issues, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? IssueReopened
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of issue assignments, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? IssueAssigned
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of issue labels, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? IssueLabelled
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of new comments, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? CommentAdded
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of edited comments, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? CommentEdited
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of milestone changes, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? MilestoneChanged
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of newly opened pull requests, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? PullRequestOpened
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of merged pull requests, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? PullRequestMerged
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of review requests, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? ReviewRequested
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Gets the stream of published releases, or <see langword="null"/> when no repository is followed.</summary>
public IObservable<string>? ReleasePublished
{
get;
private set => SetProperty(ref field, value);
}
/// <summary>Follows a repository by replacing every stream with the repository's own.</summary>
/// <param name="channels">The streams of the repository the user selected.</param>
public void Follow(RepositoryChannels channels)
{
IssueOpened = channels.IssueOpened;
IssueClosed = channels.IssueClosed;
IssueReopened = channels.IssueReopened;
IssueAssigned = channels.IssueAssigned;
IssueLabelled = channels.IssueLabelled;
CommentAdded = channels.CommentAdded;
CommentEdited = channels.CommentEdited;
MilestoneChanged = channels.MilestoneChanged;
PullRequestOpened = channels.PullRequestOpened;
PullRequestMerged = channels.PullRequestMerged;
ReviewRequested = channels.ReviewRequested;
ReleasePublished = channels.ReleasePublished;
}
/// <summary>Stops following the repository, so every stream is <see langword="null"/>.</summary>
public void Unfollow()
{
IssueOpened = null;
IssueClosed = null;
IssueReopened = null;
IssueAssigned = null;
IssueLabelled = null;
CommentAdded = null;
CommentEdited = null;
MilestoneChanged = null;
PullRequestOpened = null;
PullRequestMerged = null;
ReviewRequested = null;
ReleasePublished = null;
}
}