private void Update() { if (Input.GetButtonDown("Submit")) { persistentDatasetList = datasetListControl; if (Input.GetButtonDown("Jump")) { SceneManager.LoadScene("Data Persistence 1"); } } }
/// <summary> /// Executes the load. /// </summary> /// <param name="session">The session.</param> protected override void ExecLoad(ISession session) { DatasetList = session.Query <Target>() .Select(x => new KeyValuePair <string, int>(x.Name, x.Measures.Count())) .ToList(); DataSetsCollectionView = DatasetList.Select(x => x.Key).Where(x => x != "Physician Data").ToList(); WebsiteStructs = GetWebsites(session); TopicsStruts = GetTopics(session); GetPage(); //var allMeasures = session.Query<Measure>() // .Where(x => !x.IsOverride) // .OrderBy(x => x.Name) // .Select(x => GenExecLoadMeasure(x)) // .Cacheable() // .CacheMode(CacheMode.Normal) // .CacheRegion("MeasureLists:Measures") // .ToFuture() // .ToList(); //var distinctMeasures = allMeasures.DistinctBy(m => m.Name).ToList(); //foreach (var m in distinctMeasures) //{ // var topics = new List<Topic>(); // var assignedTopics = allMeasures.Where(x => x.Name == m.Name).Select(t => t.Topics).ToList(); // m.WebsitesForMeasureDisplay = WebsiteStructs.Where(x => x.MeasureId == m.Id).Select(w => w.WebsiteName).ToList(); // GetWebsites(session, m.Id); // if (assignedTopics.Count() == 1) continue; // assignedTopics.ForEach(topics.AddRange); // topics.DistinctBy(tt => tt.Id).ForEach(t => m.AddTopic(t)); //} //CollectionItems = new ListCollectionView(distinctMeasures.ToObservableCollection()); //SelectedMeasure = distinctMeasures.FirstOrDefault(); RaisePropertyChanged(() => CollectionItems); RaisePropertyChanged(() => HeaderText); //foreach (var item in CollectionItems.OfType<Measure>().ToList()) //{ // item.WebsitesForMeasureDisplay = GetWebsites(session, item.Id); //} }
// Just loops though getting all the rows. private static DatasetList ProcessResults(DatasetsResource.ListRequest request) { try { DatasetList result = request.Execute(); List <DatasetList.DatasetsData> allRows = new List <DatasetList.DatasetsData>(); //// Loop through until we arrive at an empty page while (result.Datasets != null) { //Add the rows to the final list allRows.AddRange(result.Datasets); // We will know we are on the last page when the next page token is // null. // If this is the case, break. if (result.NextPageToken == null) { break; } // Prepare the next page of results request.PageToken = result.NextPageToken; // Execute and process the next page request result = request.Execute(); } DatasetList allData = result; allData.Datasets = (List <DatasetList.DatasetsData>)allRows; return(allData); } catch (Exception ex) { Console.WriteLine(ex.Message); return(null); } }
private IEnumerable <DatasetList.DatasetsData> DoListRequest(string project) { DatasetsResource.ListRequest lRequest = Service.Datasets.List(project); lRequest.All = IncludeHidden; lRequest.Filter = (Filter == null) ? null : string.Join(" ", Filter.Select(item => $"labels.{item}")); do { DatasetList response = lRequest.Execute(); if (response == null) { ThrowTerminatingError(new ErrorRecord( new Exception("List request to server responded with null."), "List request returned null", ErrorCategory.InvalidArgument, project)); } if (response.Datasets != null) { foreach (DatasetList.DatasetsData d in response.Datasets) { yield return(d); } } lRequest.PageToken = response.NextPageToken; }while (!Stopping && lRequest.PageToken != null); }