/// <summary> /// Updates the data grid on the Doc generation screen /// </summary> private void UpdateDataGridItems() { m_DatagridItems.Clear(); foreach (ListViewItem l in listViewInclude.Items) { UpdatedFiles uf = new UpdatedFiles(); Char[] splitIt = { '.' }; String[] prefixExtension = l.SubItems[0].Text.Split(splitIt); HandleSpecialPcbFilenames(prefixExtension); if (m_ActiveScreen == ActiveScreen.PCB_DOC_GEN) { uf.Name = txtPCBPartNumber.Text + "-" + txtPCBRevision.Text + "." + prefixExtension[1]; } else { // Special renaming is required for Assembly package docs String appendPrefix = ""; String prefix = prefixExtension[0].ToUpper(); String ext = prefixExtension[1].ToUpper(); if ((prefix == "BILL OF MATERIALS") && (ext == "XLS")) { appendPrefix = " BOM"; } else if ((prefix == "SCHEMATIC PRINTS") && (ext == "PDF")) { appendPrefix = " SCH"; } if (ext == "ZIP") { // Intentionally don't rename uf.Name = prefix + "." + ext; } else { uf.Name = txtAssemblyPartNumber.Text + "-" + txtAssemblyRevision.Text + appendPrefix + "." + prefixExtension[1]; } } uf.Name = uf.Name.ToUpper(); uf.Description = l.SubItems[2].Text; uf.OriginalDirectory = l.SubItems[1].Text; uf.OriginalFileName = l.SubItems[0].Text; m_DatagridItems.Add(uf); } }
private void buttonMoveRowDown_Click(object sender, EventArgs e) { int position = m_BindingSource.Position; if (position == m_BindingSource.Count - 1) { return; // already at bottom } m_BindingSource.RaiseListChangedEvents = false; UpdatedFiles current = (UpdatedFiles)m_BindingSource.Current; m_BindingSource.Remove(current); position++; m_BindingSource.Insert(position, current); m_BindingSource.Position = position; m_BindingSource.RaiseListChangedEvents = true; m_BindingSource.ResetBindings(false); }