Nanook.QueenBee.AppState.loadListViewInfo C# (CSharp) Method

loadListViewInfo() private static method

private static loadListViewInfo ( ListView lv, string widths, string positions, string sort ) : void
lv System.Windows.Forms.ListView
widths string
positions string
sort string
return void
        private static void loadListViewInfo(ListView lv, string widths, string positions, string sort)
        {
            if (widths.Length != 0 && positions.Length != 0)
            {

                string[] w = widths.Split(',');
                string[] p = positions.Split(',');
                if (p.Length == lv.Columns.Count && w.Length == lv.Columns.Count)
                {
                    ColumnHeader ch;
                    for (int i = 0; i < lv.Columns.Count; i++)
                    {
                        ch = lv.Columns[int.Parse(p[i])];
                        ch.DisplayIndex = i;
                        ch.Width = int.Parse(w[i]);
                    }
                }
            }

            if (sort.Length != 0 && lv.ListViewItemSorter != null)
            {
                string[] srt = sort.Split(',');
                ListViewColumnSorter lvs = (ListViewColumnSorter)lv.ListViewItemSorter;
                lvs.SortColumn = int.Parse(srt[0]);
                lvs.Order = (SortOrder)int.Parse(srt[1]);
                lvs.Numeric = (lv.Columns[lvs.SortColumn].Text == "Length");
            }
        }