private static void saveListViewInfo(ListView lv, out string colPos, out string colWidths, out string colSort)
{
string[] colP = new string[lv.Columns.Count];
string[] colW = new string[lv.Columns.Count];
foreach (ColumnHeader ch in lv.Columns)
{
colP[ch.DisplayIndex] = ch.Index.ToString();
colW[ch.DisplayIndex] = ch.Width.ToString();
}
colPos = string.Join(",", colP);
colWidths = string.Join(",", colW);
if (lv.ListViewItemSorter != null)
colSort = string.Format("{0},{1}", ((ListViewColumnSorter)lv.ListViewItemSorter).SortColumn.ToString(), ((int)((ListViewColumnSorter)lv.ListViewItemSorter).Order).ToString());
else
colSort = string.Empty;
}