/// <summary> /// Populates local list of user layouts with internally stored values. /// Default values are created if no values are stored. /// </summary> private void refreshUserLayoutList() { var retrievedList = new List <string>(Util.StringCollectionToStringArray(Properties.Settings.Default.UserLayouts)); _userLayoutList = new List <LayoutProperty>(); //stick with an empty list if not in the correct format if (retrievedList.Count == 0 || !retrievedList[0].StartsWith("System Default")) { return; } for (var x = 0; x < retrievedList.Count; x++) { var items = retrievedList[x].Split('|'); var newLayout = new LayoutProperty { Name = items[0], PaneLocations = items[1] }; if (!String.IsNullOrEmpty(items[2])) { var userType = new FormPropertiesUserType(); newLayout.FormProperties = userType.Assemble(items[2], null) as Dictionary <string, FormProperty>; newLayout.HasCustomColumnSettings = true; } _userLayoutList.Add(newLayout); } }
public void SaveUserLayoutList() { Properties.Settings.Default.UserLayouts.Clear(); //Layout properties will be in format: //"(string)Name|(string)PaneLocationsXML|(string)FormPropertiesXML" for (var x = 0; x < _userLayoutList.Count; x++) { //Save Layout string formProperties = String.Empty; if (_userLayoutList[x].HasCustomColumnSettings) { var userType = new FormPropertiesUserType(); formProperties = (string)userType.Disassemble(_userLayoutList[x].FormProperties); } Properties.Settings.Default.UserLayouts.Add(String.Format("{0}|{1}|{2}{3}", _userLayoutList[x].Name, _userLayoutList[x].PaneLocations, formProperties, Environment.NewLine)); } Properties.Settings.Default.Save(); }
/// <summary> /// Populates local list of user layouts with internally stored values. /// Default values are created if no values are stored. /// </summary> private void refreshUserLayoutList() { var retrievedList = new List<string>(Util.StringCollectionToStringArray(Properties.Settings.Default.UserLayouts)); _userLayoutList = new List<LayoutProperty>(); //stick with an empty list if not in the correct format if (retrievedList.Count == 0 || !retrievedList[0].StartsWith("System Default")) return; for (var x = 0; x < retrievedList.Count; x++) { var items = retrievedList[x].Split('|'); var newLayout = new LayoutProperty { Name = items[0], PaneLocations = items[1] }; if (!String.IsNullOrEmpty(items[2])) { var userType = new FormPropertiesUserType(); newLayout.FormProperties = userType.Assemble(items[2], null) as Dictionary<string, FormProperty>; newLayout.HasCustomColumnSettings = true; } _userLayoutList.Add(newLayout); } }
public void SaveUserLayoutList () { Properties.Settings.Default.UserLayouts.Clear(); //Layout properties will be in format: //"(string)Name|(string)PaneLocationsXML|(string)FormPropertiesXML" for (var x = 0; x < _userLayoutList.Count; x++) { //Save Layout string formProperties = String.Empty; if (_userLayoutList[x].HasCustomColumnSettings) { var userType = new FormPropertiesUserType(); formProperties = (string) userType.Disassemble(_userLayoutList[x].FormProperties); } Properties.Settings.Default.UserLayouts.Add(String.Format("{0}|{1}|{2}{3}", _userLayoutList[x].Name, _userLayoutList[x].PaneLocations, formProperties, Environment.NewLine)); } Properties.Settings.Default.Save(); }