예제 #1
0
        public IOutputViewModel MakeOutput(Output output)
        {
            IOutputViewModel outputViewModel = IoC.Get <IOutputViewModel>();

            outputViewModel.Initialise(output);

            return(outputViewModel);
        }
예제 #2
0
        public OutputView(IOutputViewModel viewModel, IServiceProvider services, IThemeService themeService)
        {
            _services = services;
            themeService.SetTheme(this);
            DataContext = viewModel;
            _viewModel  = viewModel;
            ViewModel   = viewModel as IViewModel;

            InitializeComponent();
        }
예제 #3
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;
        }
예제 #4
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();
        }
예제 #5
0
 public OutputView(IOutputViewModel viewModel)
 {
     DataContext = viewModel;
     ViewModel   = viewModel as IViewModel;
     InitializeComponent();
 }