/// <summary> /// Populates the specified ListView with the columns and data associated with this Deck /// </summary> /// <param name="listView">The ListView to operate on</param> public void PopulateListViewWithElementColumns(ListView listView) { var listColumnNames = Translator.ListColumnNames; var arrayColumnSizes = new int[listColumnNames.Count]; for (var nCol = 0; nCol < listColumnNames.Count; nCol++) { arrayColumnSizes[nCol] = 100; } for (var nCol = 0; nCol < listView.Columns.Count && nCol < arrayColumnSizes.Length; nCol++) { arrayColumnSizes[nCol] = listView.Columns[nCol].Width; } listView.Columns.Clear(); listView.Items.Clear(); for (var nIdx = 1; nIdx < listColumnNames.Count; nIdx++) { ListViewAssist.AddColumn(listColumnNames[nIdx], arrayColumnSizes[nIdx], listView); } if (-1 != m_nCardIndex) { var listLines = CurrentLine.LineColumns; if (listLines.Count > 0) { listView.Items.Add(new ListViewItem(listLines.GetRange(1, listLines.Count - 1).ToArray())); } } }
private void ChangeElementOrder(int nChange) { if (0 == listViewElements.SelectedItems.Count) { return; } #if !MONO_BUILD Win32.SetRedraw(listViewElements.Handle, false); #endif ListViewAssist.MoveListViewItems(listViewElements, nChange); #if !MONO_BUILD Win32.SetRedraw(listViewElements.Handle, true); #endif listViewElements.Invalidate(); listViewElements.SelectedItems[0].EnsureVisible(); var listElements = new List <ProjectLayoutElement>(); foreach (ListViewItem zLvi in listViewElements.Items) { listElements.Add((ProjectLayoutElement)zLvi.Tag); } // UserAction SetupLayoutUndo(listElements); LayoutManager.Instance.ActiveLayout.Element = listElements.ToArray(); LayoutManager.Instance.FireLayoutUpdatedEvent(true); }
private void listViewSheets_Resize(object sender, EventArgs e) { ListViewAssist.ResizeColumnHeaders(listViewSheets); }
private void btnMoveUp_Click(object sender, EventArgs e) { ListViewAssist.MoveListViewItems(listViewCards, -1); }