internal override void Select(GremlinToSqlContext currentContext, string label) { int index = ProjectKeys.FindIndex(p => p == label); if (index < 0) { base.Select(currentContext, label); } else { if (ProjectContextList[index % ProjectContextList.Count].PivotVariable is GremlinGhostVariable) { var ghostVar = ProjectContextList[index % ProjectContextList.Count].PivotVariable as GremlinGhostVariable; var newGhostVar = GremlinGhostVariable.Create(ghostVar.RealVariable, ghostVar.AttachedVariable, label); currentContext.VariableList.Add(newGhostVar); currentContext.SetPivotVariable(newGhostVar); } else { GremlinGhostVariable newVariable = GremlinGhostVariable.Create(ProjectContextList[index % ProjectContextList.Count].PivotVariable, this, label); currentContext.VariableList.Add(newVariable); currentContext.SetPivotVariable(newVariable); } } }
protected override async Task OnActivateAsync(CancellationToken cancellationToken) { await base.OnActivateAsync(cancellationToken); var projectStatistics = await _tasksSource.GetProjectsStatistics(); ProjectKeys.Clear(); ProjectKeys.AddRange(projectStatistics.Select(x => x.Key)); if (SelectedProjectKey == null) { SelectedProjectKey = ProjectKeys.FirstOrDefault(); } }