private async Task <ServiceViewModel> LoadService(Service service) { var versions = await _dataSource.Value.GetVersionListAsync(service.Id); var versionModels = versions .Select(x => new VersionViewModel(this, service, x, isLastVersion: versions.Count == 1)) .OrderByDescending(x => GaeServiceExtensions.GetTrafficAllocation(service, x.Version.Id)) .ToList(); return(new ServiceViewModel(this, service, versionModels)); }
public VersionViewModel( GaeSourceRootViewModel owner, Service service, Google.Apis.Appengine.v1.Data.Version version, bool isLastVersion) { _owner = owner; _service = service; _version = version; _trafficAllocation = GaeServiceExtensions.GetTrafficAllocation(_service, _version.Id); _isLastVersion = isLastVersion; // Update the view. Caption = GetCaption(); UpdateIcon(); UpdateMenu(); }
private void Initialize() { // Get the traffic allocation for the version TrafficAllocation = GaeServiceExtensions.GetTrafficAllocation(_owner.Service, version.Id); // Reset the resources loaded and clear any children. _resourcesLoaded = false; Children.Clear(); // If the version is serving allow instances to be loaded. if (version.IsServing()) { Children.Add(s_loadingPlaceholder); } // Update the view. Caption = GetCaption(); UpdateIcon(); UpdateMenu(); }