Esempio n. 1
0
        public ResolvedVariablesContainer ResolveVariables(AppAndServerAndOverrides appAndServerAndOverrides)
        {
            var app       = appAndServerAndOverrides.Application;
            var server    = appAndServerAndOverrides.Server;
            var overrides = appAndServerAndOverrides.Overrides;

            // Hydrate the app with trusted data (ie: don't use what was sent from the browser).
            Application hydratedApp;

            using (var prestoWcf = new PrestoWcf <IApplicationService>())
            {
                hydratedApp = prestoWcf.Service.GetById(app.Id);
            }

            // Hydrate the server with trusted data (ie: don't use what was sent from the browser).
            ApplicationServer hydratedServer;

            using (var prestoWcf = new PrestoWcf <IServerService>())
            {
                hydratedServer = prestoWcf.Service.GetServerById(server.Id);
            }

            var appWithOverrides = new ApplicationWithOverrideVariableGroup();

            appWithOverrides.Application          = hydratedApp;
            appWithOverrides.CustomVariableGroups = overrides;

            return(VariableGroupResolver.Resolve(appWithOverrides, hydratedServer));
        }
Esempio n. 2
0
        private void Resolve()
        {
            RefreshAppGroupAndServer();

            var resolvedVariablesContainer = VariableGroupResolver.Resolve(this.ApplicationWithGroup, this.ApplicationServer);

            this.ResolvedCustomVariables.Clear();
            this.ResolvedCustomVariables.AddRange(resolvedVariablesContainer.Variables);

            ViewModelUtility.MainWindowViewModel.AddUserMessage(string.Format(CultureInfo.CurrentCulture,
                                                                              ViewModelResources.VariablesResolved,
                                                                              resolvedVariablesContainer.NumberOfProblems.ToString(CultureInfo.CurrentCulture),
                                                                              resolvedVariablesContainer.SupplementalStatusMessage));
        }