Ejemplo n.º 1
0
        public DeploymentDialogViewModel(IServiceProvider services, string projectName, string directoryOfProjectToDeploy, string targetFrameworkMoniker)
            : base(services)
        {
            _errorDialogService  = services.GetRequiredService <IErrorDialog>();
            TasExplorerViewModel = services.GetRequiredService <ITasExplorerViewModel>();

            OutputView      = ViewLocatorService.GetViewByViewModelName(nameof(ViewModels.OutputViewModel)) as IView;
            OutputViewModel = OutputView?.ViewModel as IOutputViewModel;

            DeploymentInProgress = false;
            PathToProjectRootDir = directoryOfProjectToDeploy;
            SelectedBuildpacks   = new ObservableCollection <string>();

            if (targetFrameworkMoniker.StartsWith(FullFrameworkTFM))
            {
                _fullFrameworkDeployment = true;
            }

            CfInstanceOptions       = new List <CloudFoundryInstance>();
            CfOrgOptions            = new List <CloudFoundryOrganization>();
            CfSpaceOptions          = new List <CloudFoundrySpace>();
            BuildpackOptions        = new List <BuildpackListItem>();
            StackOptions            = new List <string>();
            DeploymentDirectoryPath = null;

            ManifestModel = new AppManifest
            {
                Version      = 1,
                Applications = new List <AppConfig>
                {
                    new AppConfig
                    {
                        Name       = projectName,
                        Buildpacks = new List <string>(),
                    }
                }
            };

            SetManifestIfDefaultExists();

            if (TasExplorerViewModel.TasConnection != null)
            {
                TargetName = TasExplorerViewModel.TasConnection.DisplayText;
                IsLoggedIn = true;

                ThreadingService.StartTask(UpdateCfOrgOptions);
                ThreadingService.StartTask(UpdateBuildpackOptions);
                ThreadingService.StartTask(UpdateStackOptions);
            }

            _projectName = projectName;

            Expanded = false;
        }
Ejemplo n.º 2
0
        public DeploymentDialogViewModel(IServiceProvider services, string directoryOfProjectToDeploy)
            : base(services)
        {
            IView outputView = ViewLocatorService.NavigateTo(nameof(OutputViewModel)) as IView;

            outputViewModel = outputView?.ViewModel as IOutputViewModel;

            DeploymentStatus     = initialStatus;
            DeploymentInProgress = false;
            SelectedCf           = null;
            projDir = directoryOfProjectToDeploy;
            UpdateCfInstanceOptions();
        }
Ejemplo n.º 3
0
 public void OpenCloudExplorer(object arg)
 {
     ActiveView = ViewLocatorService.NavigateTo(typeof(CloudExplorerViewModel).Name);
 }