@@ -54,44 +54,6 @@ public class RepositoryCloneViewModel : BaseViewModel, IRepositoryCloneViewModel
5454 : this ( connectionRepositoryHostMap . CurrentRepositoryHost , repositoryCloneService , operatingSystem , notificationService , usageTracker )
5555 { }
5656
57- public RepositoryCloneViewModel (
58- IRepositoryHost repositoryHost ,
59- IRepositoryModel repositoryToClone ,
60- IRepositoryCloneService cloneService ,
61- IOperatingSystem operatingSystem ,
62- INotificationService notificationService ,
63- IUsageTracker usageTracker )
64- {
65- this . repositoryHost = repositoryHost ;
66- this . cloneService = cloneService ;
67- this . operatingSystem = operatingSystem ;
68- this . notificationService = notificationService ;
69- this . usageTracker = usageTracker ;
70- this . SelectedRepository = repositoryToClone ;
71-
72- Title = string . Format ( CultureInfo . CurrentCulture , Resources . CloneTitle , repositoryHost . Title ) ;
73-
74- var baseRepositoryPath = this . WhenAnyValue ( x => x . BaseRepositoryPath ) ;
75-
76- BaseRepositoryPathValidator = ReactivePropertyValidator . ForObservable ( baseRepositoryPath )
77- . IfNullOrEmpty ( Resources . RepositoryCreationClonePathEmpty )
78- . IfTrue ( x => x . Length > 200 , Resources . RepositoryCreationClonePathTooLong )
79- . IfContainsInvalidPathChars ( Resources . RepositoryCreationClonePathInvalidCharacters )
80- . IfPathNotRooted ( Resources . RepositoryCreationClonePathInvalid )
81- . IfTrue ( IsAlreadyRepoAtPath , Resources . RepositoryNameValidatorAlreadyExists ) ;
82-
83- var canCloneObservable = this . WhenAny (
84- x => x . SelectedRepository ,
85- x => x . BaseRepositoryPathValidator . ValidationResult . IsValid ,
86- ( x , y ) => x . Value != null && y . Value ) ;
87- canClone = canCloneObservable . ToProperty ( this , x => x . CanClone ) ;
88- CloneCommand = ReactiveCommand . CreateAsyncObservable ( canCloneObservable , OnCloneRepository ) ;
89-
90- browseForDirectoryCommand . Subscribe ( _ => ShowBrowseForDirectoryDialog ( ) ) ;
91- this . WhenAny ( x => x . BaseRepositoryPathValidator . ValidationResult , x => x . Value )
92- . Subscribe ( ) ;
93- BaseRepositoryPath = cloneService . DefaultClonePath ;
94- }
9557
9658 public RepositoryCloneViewModel (
9759 IRepositoryHost repositoryHost ,
0 commit comments