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

            if (pref.Load())
            {
                bool  ok = false;
                Point p  = pref.GetPoint("Point", out ok);
                if (ok)
                {
                    this.Location = p;
                }
                bool[] wl = pref.GetBoolArray("WizLimit", out ok);
                if (ok)
                {
                    this.LimitValues = wl;
                }
                string s = pref.GetString("PictureFolder", out ok);
                if (ok)
                {
                    if (System.IO.Directory.Exists(s) == true)
                    {
                        wizPictureBox1.PicureFolderPath = s;
                    }
                }
            }
            // this.Text = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
        }
Beispiel #2
0
        //--------------------------------------------------------------------------------------
        public bool PrefLoad()
        {
            bool ret = false;
            //設定ファイルの保存
            JsonPref pref = new JsonPref();

            if (pref.Load() == true)
            {
                bool  ok = false;
                Point p  = pref.GetPoint("Point", out ok);
                if (ok)
                {
                    this.Location = p;
                }
                int h = pref.GetInt("Height", out ok);
                if (ok)
                {
                    this.Height = h;
                }
                int[] a = pref.GetIntArray("ParamsInt", out ok);
                if (ok)
                {
                    tsGrid1.tsd.ParamsInt = a;
                }
                bool[] b = pref.GetBoolArray("ParamsBool", out ok);
                if (ok)
                {
                    tsGrid1.tsd.ParamsBool = b;
                }
                int[] c = pref.GetIntArray("Colors", out ok);
                if (ok)
                {
                    tsGrid1.cols.ColorInt = c;
                }
                int[] d = pref.GetIntArray("Keys", out ok);
                if (ok)
                {
                    tsGrid1.funcs.FuncTableAll = d;
                }
                ret = true;
            }
            return(ret);
        }