Esempio n. 1
0
        //********************************************************************************
        /// <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 void SavePosition(Form form, Form refform)
        {
            if (form.WindowState == FormWindowState.Minimized ||
                form.WindowState == FormWindowState.Maximized)
            {
                return;
            }

            int x  = form.Left;
            int y  = form.Top;
            int cx = form.Width;
            int cy = form.Height;

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0},{1},{2},{3}", x, y, cx, cy);

            // Immer möglichst die relative Position mit abspeichern
            if (form.Parent == null && refform != null && refform.WindowState != FormWindowState.Minimized)
            {
                int dx = x - refform.Left;
                int dy = y - refform.Top;
                sb.AppendFormat(",{0},{1}", dx, dy);
            }

            PlProfile.WriteString("Pos", form.Name, sb.ToString());
        }
Esempio n. 2
0
        //********************************************************************************
        /// <summary>
        /// Save the list to the profile, see PlProfile.SetProfileName()
        /// </summary>
        /// <returns></returns>
        /// <created>UPh,16.03.2007</created>
        /// <changed>UPh,16.03.2007</changed>
        //********************************************************************************
        internal void Save()
        {
            int count = m_Items.Count;

            PlProfile.WriteInt(m_Section, "Count", count);

            for (int i = 0; i < count; i++)
            {
                PlProfile.WriteString(m_Section, Convert.ToString(i), m_Items[i]);
            }
        }
Esempio n. 3
0
        //********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="c"></param>
        /// <returns></returns>
        /// <created>UPh,27.12.2007</created>
        /// <changed>UPh,27.12.2007</changed>
        //********************************************************************************
        static void SavePosition(ListView c)
        {
            StringBuilder strPos = new StringBuilder();

            for (int i = 0; i < c.Columns.Count; i++)
            {
                if (i > 0)
                {
                    strPos.Append(",");
                }
                strPos.AppendFormat("{0}", c.Columns[i].Width);
            }

            PlProfile.WriteString("Pos", MakeControlName(c), strPos.ToString());
        }
Esempio n. 4
0
        //********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="c"></param>
        /// <returns></returns>
        /// <created>UPh,27.12.2007</created>
        /// <changed>UPh,27.12.2007</changed>
        //********************************************************************************
        static void SavePosition(SplitContainer c)
        {
            int max = 0;

            if (c.Orientation == Orientation.Horizontal)
            {
                max = c.Height;
            }
            else
            {
                max = c.Width;
            }
            if (max <= 1)
            {
                return;
            }

            int percent = (c.SplitterDistance * 10000) / max;

            PlProfile.WriteString("Pos", MakeControlName(c), percent.ToString());
        }