//******************************************************************************** /// <summary> /// /// </summary> /// <param name="c"></param> /// <returns></returns> /// <created>UPh,27.12.2007</created> /// <changed>UPh,27.12.2007</changed> //******************************************************************************** static internal void RestorePosition(SplitContainer c) { int max = 0; if (c.Orientation == Orientation.Horizontal) { max = c.Height; } else { max = c.Width; } if (max <= 1) { return; } string strPos = PlProfile.GetString("Pos", MakeControlName(c)); int pos; if (!Int32.TryParse(strPos, out pos) || pos < 0 || pos > 10000) { return; } c.SplitterDistance = (pos * max) / 10000; }
//******************************************************************************** /// <summary> /// /// </summary> /// <param name="c"></param> /// <returns></returns> /// <created>UPh,27.12.2007</created> /// <changed>UPh,27.12.2007</changed> //******************************************************************************** static internal void RestorePosition(ListView c) { string strPos = PlProfile.GetString("Pos", MakeControlName(c)); int[] arr = GetIntArray(strPos); if (arr == null) { return; } if (arr.Length != c.Columns.Count) { return; } for (int i = 0; i < arr.Length; i++) { c.Columns[i].Width = arr[i]; } }
//******************************************************************************** /// <summary> /// Initializes data and loads RecentList from profile /// </summary> /// <param name="section"></param> /// <param name="maxsize"></param> /// <returns></returns> /// <created>UPh,16.03.2007</created> /// <changed>UPh,16.03.2007</changed> //******************************************************************************** private void Initialize(string section, int maxsize) { m_Items = new List <string>(); m_MaxSize = maxsize; m_Section = section; // Lade aus demProfil int count = PlProfile.GetInt(m_Section, "Count"); for (int i = 0; i < count; i++) { string value = PlProfile.GetString(section, Convert.ToString(i)); if (value == "") { continue; } m_Items.Add(value); } }
//******************************************************************************** /// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="refform"></param> /// <returns></returns> /// <created>UPh,27.12.2007</created> /// <changed>UPh,27.12.2007</changed> //******************************************************************************** static internal void RestorePosition(Form form, Form refform) { string strPos = PlProfile.GetString("Pos", form.Name); int[] arr = GetIntArray(strPos); if (arr == null) { return; } if (arr.Length != 4 && arr.Length != 6) { return; } int left = arr[0]; int top = arr[1]; int width = arr[2]; int height = arr[3]; if (form.Parent == null && arr.Length == 6 && refform != null && refform.WindowState != FormWindowState.Minimized) { int dx = arr[4]; int dy = arr[5]; left = refform.Left + dx; top = refform.Top + dy; } form.Left = left; form.Top = top; if (form.FormBorderStyle == FormBorderStyle.Sizable || form.FormBorderStyle == FormBorderStyle.SizableToolWindow) { form.Width = width; form.Height = height; } MakeVisible(form); }