void CreateViewModel(
			FakePackageManagementSolution solution, 
			IThreadSafePackageManagementEvents packageManagementEvents)
		{
			fakeTaskFactory = new FakeTaskFactory();
			fakeLicenseAcceptanceService = new FakeLicenseAcceptanceService();
			fakeSelectProjectsService = new FakeSelectProjectsService();
			userPrompts = new ManagePackagesUserPrompts(
				packageManagementEvents,
				fakeLicenseAcceptanceService,
				fakeSelectProjectsService);
			fakeActionRunner = new FakePackageActionRunner();
			
			packagesViewModels = new PackagesViewModels(
				solution,
				fakeRegisteredPackageRepositories,
				packageManagementEvents,
				fakeActionRunner,
				fakeTaskFactory);
			
			viewTitle = new ManagePackagesViewTitle(solution);
			
			viewModel = new ManagePackagesViewModel(
				packagesViewModels,
				viewTitle,
				packageManagementEvents,
				userPrompts);
			fakeTaskFactory.ExecuteAllFakeTasks();
		}
Ejemplo n.º 2
0
        void CreateViewModel(
            FakePackageManagementSolution solution,
            IThreadSafePackageManagementEvents packageManagementEvents)
        {
            fakeTaskFactory = new FakeTaskFactory();
            fakeLicenseAcceptanceService = new FakeLicenseAcceptanceService();
            fakeSelectProjectsService    = new FakeSelectProjectsService();
            fakeFileConflictResolver     = MockRepository.GenerateStub <IFileConflictResolver>();
            userPrompts = new ManagePackagesUserPrompts(
                packageManagementEvents,
                fakeLicenseAcceptanceService,
                fakeSelectProjectsService,
                fakeFileConflictResolver);
            fakeActionRunner = new FakePackageActionRunner();

            packagesViewModels = new TestablePackagesViewModels(
                solution,
                fakeRegisteredPackageRepositories,
                packageManagementEvents,
                fakeActionRunner,
                fakeTaskFactory);

            viewTitle = new ManagePackagesViewTitle(solution);

            viewModel = new ManagePackagesViewModel(
                packagesViewModels,
                viewTitle,
                packageManagementEvents,
                userPrompts);
            fakeTaskFactory.ExecuteAllFakeTasks();
        }
		public AddPackagesDialog (
			ManagePackagesViewModel parentViewModel,
			string initialSearch,
			IBackgroundPackageActionRunner backgroundActionRunner,
			IRecentPackageRepository recentPackageRepository)
		{
			this.parentViewModel = parentViewModel;
			this.viewModel = parentViewModel.AvailablePackagesViewModel;
			this.backgroundActionRunner = backgroundActionRunner;
			this.recentPackageRepository = recentPackageRepository;

			Build ();

			UpdatePackageSearchEntryWithInitialText (initialSearch);

			InitializeListView ();
			UpdateAddPackagesButton ();
			ShowLoadingMessage ();
			LoadViewModel (initialSearch);

			this.showPrereleaseCheckBox.Clicked += ShowPrereleaseCheckBoxClicked;
			this.packageSourceComboBox.SelectionChanged += PackageSourceChanged;
			this.addPackagesButton.Clicked += AddPackagesButtonClicked;
			this.packageSearchEntry.Changed += PackageSearchEntryChanged;
			this.packageSearchEntry.Activated += PackageSearchEntryActivated;
			imageLoader.Loaded += ImageLoaded;
		}
		public AddPackagesDialog (ManagePackagesViewModel parentViewModel, string initialSearch = null)
			: this (
				parentViewModel,
				initialSearch,
				PackageManagementServices.BackgroundPackageActionRunner,
				PackageManagementServices.RecentPackageRepository)
		{
		}
        public ManagePackagesDialog(ManagePackagesViewModel viewModel, IPackageManagementEvents packageManagementEvents)
        {
            this.Build ();

            this.viewModel = viewModel;
            this.packageManagementEvents = packageManagementEvents;
            AddPackageManagementEventHandlers ();
            LoadViewModels ();
        }
Ejemplo n.º 6
0
		public ManagePackagesDialog (ManagePackagesViewModel viewModel, IPackageManagementEvents packageManagementEvents)
		{
			this.Build ();
			this.messagesExpanderDefaultLabel = messagesExpander.Label;
			
			this.viewModel = viewModel;
			this.packageManagementEvents = packageManagementEvents;
			AddPackageManagementEventHandlers ();
			LoadViewModels ();
		}
		void CreateManagePackagesViewModel()
		{
			CreateRegisteredPackageRepositories();
			CreateSolution();
			ThreadSafePackageManagementEvents packageManagementEvents = CreateThreadSafePackageManagementEvents();
			PackagesViewModels packagesViewModels = CreatePackagesViewModels(packageManagementEvents);

			managePackagesViewModel = 
				new ManagePackagesViewModel(
					packagesViewModels,
					new ManagePackagesViewTitle(solution),
					packageManagementEvents);
		}
		void CreateManagePackagesViewModel()
		{
			CreateRegisteredPackageRepositories();
			CreateSolution();
			var packageManagementEvents = new ThreadSafePackageManagementEvents(PackageManagementServices.PackageManagementEvents);
			managePackagesViewModel = 
				new ManagePackagesViewModel(
					solution,
					registeredPackageRepositories,
					packageManagementEvents,
					PackageManagementServices.PackageActionRunner,
					new LicenseAcceptanceService(),
					new PackageManagementTaskFactory());
		}
		void CreateViewModel(FakePackageManagementSolution solution, IThreadSafePackageManagementEvents packageManagementEvents)
		{
			taskFactory = new FakeTaskFactory();
			fakeLicenseAcceptanceSevice = new FakeLicenseAcceptanceService();
			fakeActionRunner = new FakePackageActionRunner();
			viewModel = new ManagePackagesViewModel(
				solution,
				fakeRegisteredPackageRepositories,
				packageManagementEvents,
				fakeActionRunner,
				fakeLicenseAcceptanceSevice,
				taskFactory);
			taskFactory.ExecuteAllFakeTasks();
		}
Ejemplo n.º 10
0
		protected override void Dispose (bool disposing)
		{
			imageLoader.Loaded -= ImageLoaded;
			imageLoader.Dispose ();

			viewModel.PropertyChanged -= ViewModelPropertyChanged;
			parentViewModel.Dispose ();
			DisposeExistingTimer ();
			packageStore.Clear ();
			viewModel = null;
			parentViewModel = null;
			base.Dispose (disposing);
		}