1+ using System ;
2+ using System . Threading . Tasks ;
3+ using GitHub . Models ;
4+ using GitHub . ViewModels ;
5+ using GitHub . ViewModels . Dialog ;
6+ using Octokit ;
7+ using ReactiveUI ;
8+ using IConnection = GitHub . Models . IConnection ;
9+
10+ namespace GitHub . SampleData
11+ {
12+ public class ForkRepositoryExecuteViewModelDesigner : ViewModelBase , IForkRepositoryExecuteViewModel
13+ {
14+ public ForkRepositoryExecuteViewModelDesigner ( )
15+ {
16+ SourceRepository = new RemoteRepositoryModelDesigner
17+ {
18+ Owner = "github" ,
19+ Name = "VisualStudio" ,
20+ CloneUrl = "https://github.com/github/VisualStudio" ,
21+ } ;
22+ DestinationRepository = new RemoteRepositoryModelDesigner
23+ {
24+ Owner = "user" ,
25+ Name = "VisualStudio" ,
26+ CloneUrl = "https://github.com/user/VisualStudio" ,
27+ } ;
28+ DestinationAccount = new AccountDesigner ( ) ;
29+ }
30+
31+ public IObservable < object > Done => null ;
32+
33+ public string Title => null ;
34+
35+ public IRepositoryModel SourceRepository { get ; set ; }
36+
37+ public IRepositoryModel DestinationRepository { get ; set ; }
38+
39+ public IAccount DestinationAccount { get ; }
40+
41+ public IReactiveCommand < Repository > CreateFork => null ;
42+
43+ public bool ResetMasterTracking { get ; set ; } = true ;
44+
45+ public bool AddUpstream { get ; set ; } = true ;
46+
47+ public bool UpdateOrigin { get ; set ; } = true ;
48+
49+ public bool CanAddUpstream => UpdateOrigin ;
50+
51+ public bool CanResetMasterTracking => UpdateOrigin && AddUpstream ;
52+
53+ public string Error { get ; } = "I AM ERROR" ;
54+
55+ public Task InitializeAsync ( ILocalRepositoryModel sourceRepository , IAccount destinationAccount , IConnection connection )
56+ {
57+ return Task . CompletedTask ;
58+ }
59+ }
60+ }
0 commit comments