Пример #1
0
        public LoginViewModel(IServiceProvider services)
            : base(services)
        {
            SkipSsl = true;

            ApiAddressIsValid = true;

            _tasExplorer = services.GetRequiredService <ITasExplorerViewModel>();
            _ssoDialog   = services.GetRequiredService <ISsoDialogViewModel>();
        }
Пример #2
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;
        }