private Targil targil; // the Targil of form #endregion Fields #region Constructors public Regular(Peula peula, QuestionType qType) { InitializeComponent(); this.Icon = new Icon(Properties.Resources.App_Icon, new Size(32, 32)); this.targil = new Targil(qType); this.qT = qType; this.targil.peula = peula; this.peula = peula; #region set title of form if (peula == Peula.hibur) this.Text = Languages.ChosenLanguage.Default["plus"]; else if (peula == Peula.hisur) this.Text = Languages.ChosenLanguage.Default["minus"]; else if (peula == Peula.kefel) this.Text = Languages.ChosenLanguage.Default["kefel"]; else if (peula == Peula.hiluk) this.Text = Languages.ChosenLanguage.Default["hiluk"]; else if (peula == Peula.random) this.Text = Languages.ChosenLanguage.Default["random"]; #endregion set title of form this.lb_time.Text = Languages.ChosenLanguage.Default["time"] + "00:00"; this.RightToLeft = Languages.ChosenLanguage.dir; this.RightToLeftLayout = Languages.ChosenLanguage.dirLayout; bt_ok.Text = Languages.ChosenLanguage.Default["send"]; this.Font = Code.Files.PreferrenceFile.GetReadyFont; SetNumbers(); }
public static Targil Parse(string txt) { try { Targil t = new Targil(0); txt.Replace("(", ""); txt.Replace(")", ""); string[] ar = txt.Split('&'); t.number1 = int.Parse(ar[0]); t.number2 = int.Parse(ar[2]); t.peula = (Peula)byte.Parse(ar[1]); t.qType = int.Parse(ar[3]); return t; } catch { return new Targil(0); } }