private void clusterStatsResponse(ClusterStatsResponse resp, bool ok) { if (!ok) { ++_clusterReportsGenerated; if (ClustersAndLinksDone()) { finalizeReport(); } return; } //generate list of ArgPoints var argPoints = new ArgPoint[resp.points.Length]; for (int i = 0; i < resp.points.Length; i++) { var pointId = resp.points[i]; argPoints[i] = _ctx.ArgPoint.FirstOrDefault(ap0 => ap0.Id == pointId); } var topic = _ctx.Topic.FirstOrDefault(t0 => t0.Id == resp.topicId); var initialOwner = _ctx.Person.FirstOrDefault(p0 => p0.Id == resp.initialOwnerId); var report = new ClusterReport(topic, resp.clusterId, resp.clusterShId, resp.clusterTextTitle, argPoints, initialOwner); _clusterReports.Add(report); ++_clusterReportsGenerated; if (ClustersAndLinksDone()) { finalizeReport(); } }
private TreeViewItem GetCluster(ClusterReport report) { var res = new TreeViewItem(); res.Header = GetHeader(report.initialOwner, " - cluster " + report.clusterTitle); var argPoints = WrapNode("Arg. points"); foreach (var ap in report.points) { argPoints.Items.Add(GetPointReport(ap)); } res.Items.Add(argPoints); return(res); }
private TreeViewItem GetCluster(ClusterReport report) { var res = new TreeViewItem(); res.Header = GetHeader(report.initialOwner, " - cluster " + report.clusterTitle); var argPoints = WrapNode("Arg. points"); foreach (var ap in report.points) argPoints.Items.Add(GetPointReport(ap)); res.Items.Add(argPoints); return res; }
private void clusterStatsResponse(ClusterStatsResponse resp, bool ok) { if (!ok) { ++_clusterReportsGenerated; if (ClustersAndLinksDone()) finalizeReport(); return; } //generate list of ArgPoints var argPoints = new ArgPoint[resp.points.Length]; for (int i = 0; i < resp.points.Length; i++) { var pointId = resp.points[i]; argPoints[i] = _ctx.ArgPoint.FirstOrDefault(ap0 => ap0.Id == pointId); } var topic = _ctx.Topic.FirstOrDefault(t0 => t0.Id == resp.topicId); var initialOwner = _ctx.Person.FirstOrDefault(p0 => p0.Id == resp.initialOwnerId); var report = new ClusterReport(topic, resp.clusterId, resp.clusterShId, resp.clusterTextTitle, argPoints, initialOwner); _clusterReports.Add(report); ++_clusterReportsGenerated; if (ClustersAndLinksDone()) finalizeReport(); }