private void SetControlInformation(object controlName, TableLayoutSettings.ControlInformation info) { if (this.controlsInfo == null) { this.controlsInfo = new Dictionary <object, TableLayoutSettings.ControlInformation>(); } this.controlsInfo[controlName] = info; }
public void SetRowSpan(object controlName, int value) { if (this.GetRowSpan(controlName) != value) { TableLayoutSettings.ControlInformation controlInformation = this.GetControlInformation(controlName); controlInformation.RowSpan = value; this.SetControlInformation(controlName, controlInformation); } }
public void SetRow(object controlName, int row) { if (this.GetRow(controlName) != row) { TableLayoutSettings.ControlInformation controlInformation = this.GetControlInformation(controlName); controlInformation.Row = row; this.SetControlInformation(controlName, controlInformation); } }
public void SetColumn(object controlName, int column) { if (this.GetColumn(controlName) != column) { TableLayoutSettings.ControlInformation controlInformation = this.GetControlInformation(controlName); controlInformation.Column = column; this.SetControlInformation(controlName, controlInformation); } }
internal List <TableLayoutSettings.ControlInformation> GetControlsInformation() { if (this.controlsInfo == null) { return(new List <TableLayoutSettings.ControlInformation>()); } List <TableLayoutSettings.ControlInformation> list = new List <TableLayoutSettings.ControlInformation>(this.controlsInfo.Count); foreach (object obj2 in this.controlsInfo.Keys) { TableLayoutSettings.ControlInformation item = this.controlsInfo[obj2]; item.Name = obj2; list.Add(item); } return(list); }
internal void ApplySettings(TableLayoutSettings settings) { TableLayout.ContainerInfo containerInfo = TableLayout.GetContainerInfo(settings.Owner); Control container = containerInfo.Container as Control; if ((container != null) && (this.controlsInfo != null)) { foreach (object obj2 in this.controlsInfo.Keys) { TableLayoutSettings.ControlInformation information = this.controlsInfo[obj2]; foreach (Control control2 in container.Controls) { if (control2 != null) { string str = null; PropertyDescriptor descriptor = TypeDescriptor.GetProperties(control2)["Name"]; if ((descriptor != null) && (descriptor.PropertyType == typeof(string))) { str = descriptor.GetValue(control2) as string; } if (WindowsFormsUtils.SafeCompareStrings(str, obj2 as string, false)) { settings.SetRow(control2, information.Row); settings.SetColumn(control2, information.Column); settings.SetRowSpan(control2, information.RowSpan); settings.SetColumnSpan(control2, information.ColumnSpan); break; } } } } } containerInfo.RowStyles = this.rowStyles; containerInfo.ColumnStyles = this.columnStyles; this.columnStyles = null; this.rowStyles = null; this.isValid = false; }