예제 #1
0
파일: XGConfig.cs 프로젝트: wwkkww1983/bt
        public void deser()
        {
            object obj = new SoapSerialize().SoapDeserialize();

            if (obj != null)
            {
                ArrayList list = obj as ArrayList;
                if (list != null)
                {
                    try
                    {
                        //todo:
                        this.a1gp = (ALUL)list[0];
                        a1bp      = (ALUL)list[1];
                        a1gt      = (ALUL)list[2];
                        a1bt      = (ALUL)list[3];
                        a2gp      = (ALUL)list[4];
                        a2bp      = (ALUL)list[5];
                        a2gt      = (ALUL)list[6];
                        a2bt      = (ALUL)list[7];
                    }
                    catch (Exception ex)
                    {
                        MsgBox.Show(ex.ToString());
                    }
                }
            }
        }
예제 #2
0
        private void Check(TextBox t, ALUL a)
        {
            if (t.Text == null || t.Text.Length == 0)
            {
                return;
            }

            if (!a.Enabled)
            {
                t.ForeColor = nc;
                return;
            }

            float f = 0;

            try
            {
                f = float.Parse(t.Text);
            }
            catch
            {
                return;
            }

            if (f < a.L || f > a.U)
            {
                t.ForeColor = ec;
            }
            else
            {
                t.ForeColor = nc;
            }
        }