Exemplo n.º 1
0
        //-------------------------------------------------------------
        /// <summary>
        /// フォーム作成時に呼ばれる
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainForm_Load(object sender, EventArgs e)
        {
            //設定ファイルの読み込み
            PrefFile pref = new PrefFile();

            if (pref.Load())
            {
                Size sz;
                if (pref.GetSize("Size", out sz))
                {
                    this.Size = sz;
                }
                Point p;
                if (pref.GetPoint("Point", out p))
                {
                    this.Location = p;
                }
                double v = -1;
                if (pref.GetNum("index", out v))
                {
                    if (v >= 0)
                    {
                        memoEditList1.SelectedMemoIndex = (int)v;
                    }
                }
                string s = ""; double f = 14;
                if (pref.GetStr("font", out s) && pref.GetNum("fontsize", out f))
                {
                    memoEditList1.TextFont = new Font(s, (float)f);
                }
                bool b = true;
                if (pref.GetBool("IsEncodeUTF-8", out b))
                {
                    encodeUTF8CMenu.Checked    = b;
                    encodeShftJISCMenu.Checked = !b;
                }
            }
            this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
            string pp = Path.Combine(pref.PrefFolder, "Memos.json");

            if (File.Exists(pp))
            {
                memoEditList1.LoadAll(pp);
            }
        }
Exemplo n.º 2
0
        //-------------------------------------------------------------
        /// <summary>
        /// フォーム作成時に呼ばれる
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            //設定ファイルの読み込み
            PrefFile pref = new PrefFile();

            if (pref.Load())
            {
                Size sz;
                if (pref.GetSize("Size", out sz))
                {
                    this.Size = sz;
                }
                Point p;
                if (pref.GetPoint("Point", out p))
                {
                    this.Location = p;
                }
            }
            this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
        }
Exemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            PrefFile pref = new PrefFile();

            if (pref.Load())
            {
                Size sz;
                if (pref.GetSize("Size", out sz))
                {
                    this.Size = sz;
                }
                Point p;
                if (pref.GetPoint("Point", out p))
                {
                    this.Location = p;
                }
            }
            this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
        }