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)); }
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)); }