Пример #1
0
 public override string ToString()
 {
     return(string.Format("{{{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}}}", H1.ToString("f" + 0), H2.ToString("f" + 9), H3.ToString("f" + 9), H4.ToString("f" + 9), H5.ToString("f" + 9), H6.ToString("f" + 9), H7.ToString("f" + 9), H8.ToString("f" + 9), H9.ToString("f" + 9), H10.ToString("f" + 9)));
 }
Пример #2
0
        public void Read_From_File()
        {
            #region USER DATA

            List <string> lst_content = new List <string>(File.ReadAllLines(user_input_file));
            string        kStr        = "";
            MyList        mList       = null;
            string        VarName     = "";

            #endregion
            int indx = -1;
            try
            {
                for (int i = 0; i < lst_content.Count; i++)
                {
                    kStr    = MyList.RemoveAllSpaces(lst_content[i]);
                    mList   = new MyList(kStr, '=');
                    VarName = MyList.RemoveAllSpaces(mList.StringList[0]);

                    //sw.WriteLine("={0}", Q);
                    //sw.WriteLine("={0}", V);
                    //sw.WriteLine("={0}", B);
                    //sw.WriteLine("={0}", H1);
                    //sw.WriteLine("={0}", H2);
                    //sw.WriteLine("W={0}", W);
                    //sw.WriteLine("I={0}", I);
                    #region SWITCH
                    switch (VarName)
                    {
                    case "Q":
                        Q          = mList.GetDouble(1);
                        txt_Q.Text = Q.ToString();
                        break;

                    case "V":
                        V          = mList.GetDouble(1);
                        txt_V.Text = V.ToString();
                        break;

                    case "B":
                        B          = mList.GetDouble(1);
                        txt_B.Text = B.ToString();
                        break;

                    case "H1":
                        H1          = mList.GetDouble(1);
                        txt_H1.Text = H1.ToString();
                        break;

                    case "H2":
                        H2          = mList.GetDouble(1);
                        txt_H2.Text = H2.ToString();
                        break;

                    case "W":
                        W          = mList.GetDouble(1);
                        txt_W.Text = W.ToString();
                        break;

                    case "I":
                        I          = mList.GetDouble(1);
                        txt_I.Text = I.ToString();
                        break;
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
            }
            lst_content.Clear();
        }