hMailServer.Administrator.ucListView.SaveWidths C# (CSharp) Method

SaveWidths() public method

Saves the width of the columns in the registry.
public SaveWidths ( string viewName ) : void
viewName string
return void
        public void SaveWidths(string viewName)
        {
            var currentUserKey = Registry.CurrentUser;
             var administratorKey = currentUserKey.CreateSubKey(ListViewSaveLocation);

             for (int i = 0; i < Columns.Count; i++)
             {
            var columnHeader = Columns[i];
            string columnName = viewName + "_" + columnHeader.Text;
            administratorKey.SetValue(columnName, columnHeader.Width);
             }

             administratorKey.Close();
             currentUserKey.Close();
        }