private void barButtonItem_DauSongSong_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ManageCircle temp = new ManageCircle(); temp = mgCircles; List<Circle> firstCollum = temp.GetListCirleOfFirstColumn(); List<Circle> lastCollum = temp.GetListCirleOfLastColumn(); int rowNumber = temp.GetRowCount(); double sumY1 = 0, sumY2 = 0; double x1 = 0, y1 = 0, x2 = 0, y2 = 0; foreach (Circle c in firstCollum) { x1 = c.GetX(); sumY1 += c.GetY(); } foreach (Circle c in lastCollum) { x2 = c.GetX(); sumY2 += c.GetY(); } y1 = y2 = sumY1 / rowNumber; x1 = x1 - banVeChinh.DeltaX; x2 = x2 + banVeChinh.DeltaX; foreach(Circle c in firstCollum) { DrawLine(c.GetX(), c.GetY(), x1, y1); } foreach (Circle c in lastCollum) { DrawLine(c.GetX(), c.GetY(), x2, y2); } int lineIndex = 1; do { List<Circle> currentRow = temp.GetListCircleRow(lineIndex); for (int i = 0; i < currentRow.Count - 1; i++) { DrawLine_X(currentRow[i], currentRow[i + 1]); } lineIndex++; //temp.RemoveListCircles(currentRow); } while (lineIndex <= temp.GetRowCount()); Lcad.DrwRegenViews(hDrw, 0); Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0); }
private void barButtonItem_DauNoiTiep_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ManageCircle temp = new ManageCircle(); temp = mgCircles; int lineIndex = 1; do { List<Circle> currentRow = temp.GetListCircleRow(lineIndex); for (int i = 0; i < currentRow.Count - 1; i++) { DrawLine_X(currentRow[i], currentRow[i + 1]); } if(lineIndex % 2 != 0) { List<Circle> currentCollum = temp.GetListCirleOfLastColumn(); if(currentCollum.Count > 1) { DrawLine_Y(currentCollum[0], currentCollum[1]); } } else { List<Circle> currentCollum = temp.GetListCirleOfFirstColumn(); if (currentCollum.Count > 1) { DrawLine_Y(currentCollum[0], currentCollum[1]); } } //temp.RemoveListCircles(currentRow); lineIndex++; } while (lineIndex <= temp.GetRowCount()); Lcad.DrwRegenViews(hDrw, 0); Lcad.WndExeCommand(hWnd, Lcad.LC_CMD_ZOOM_EXT, 0); }