Ejemplo n.º 1
0
 private void FindWord_FormClosed(object sender, FormClosedEventArgs e)
 {
     test.ResetUsedIndexes();
     this.Hide();
     FormMaintenance.GetInstance().UnregisterFindWord();
     FormMaintenance.GetInstance().GetTestModeInstance().Show();
 }
Ejemplo n.º 2
0
 public WordTest(Test t) : this()
 {
     FormMaintenance.GetInstance().RegisterFindWord(this);
     test = t;
     if (test != null)
     {
         lblTestType.Text = test.GetTestType();
     }
 }
Ejemplo n.º 3
0
        public TestMode(WordList w) : this()
        {
            FormMaintenance.GetInstance().RegisterTestMode(this);
            wl = w;

            // Add entries to list
            foreach (WordEntry we in wl)
            {
                cboFrom.Items.Add(we.GetWord());
                cboTill.Items.Add(we.GetWord());
            }
        }
Ejemplo n.º 4
0
        public GREMaster()
        {
            InitializeComponent();
            wl         = new WordList();
            serializer = new SerializerFactory().GetSerializer("WordList.xml");

            //Splash.ShowSplashScreen(serializer);
            //Thread.Sleep(2000);
            serializer.LoadWordList(wl);

            FormMaintenance.GetInstance().RegisterGREMaster(this);
        }
Ejemplo n.º 5
0
 private void WordListDialog_FormClosed(object sender, FormClosedEventArgs e)
 {
     FormMaintenance.GetInstance().UnregisterWordListDialog();
     if (bIsNormalFlow)
     {
         FormMaintenance.GetInstance().GetGREMasterInstance().Show();
     }
     else
     {
         FormMaintenance.GetInstance().GetFindWordInstance().Show();
     }
 }
Ejemplo n.º 6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            // Validate if we have atleast the word
            if (txtWord.Text.Length > 0)
            {
                // Create a WordEntry object from input
                WordEntry we = new WordEntry();
                we.SetWord(txtWord.Text);

                // Meanings
                String[] strMeanings = txtMeanings.Lines;
                foreach (String str in strMeanings)
                {
                    if (str.Length > 0)
                    {
                        we.AddMeaning(str);
                    }
                }
                // Usages
                String[] strUsages = txtUsages.Lines;
                foreach (String str in strUsages)
                {
                    if (str.Length > 0)
                    {
                        we.AddUsage(str);
                    }
                }
                // Other info
                String[] strOther = txtOtherInfo.Lines;
                foreach (String str in strOther)
                {
                    if (str.Length > 0)
                    {
                        we.AddOtherInfo(str);
                    }
                }

                // Now, we have the entry. Add it to the ArrayWordList
                Boolean ret = wl.AddEntry(we);

                // Update the UI.
                if (ret)
                {
                    lstWordList.Items.Add(we.GetWord());
                }

                Clear();
            }
            FormMaintenance.GetInstance().GetGREMasterInstance().GetSerializer().SetChanged(true);
        }
Ejemplo n.º 7
0
        public WordListDialog(WordList w) : this()
        {
            FormMaintenance.GetInstance().RegisterWordListDialog(this);
            bIsUpdated    = false;
            bIsNormalFlow = true;
            wl            = w;

            // Add entries to list
            foreach (WordEntry we in wl)
            {
                lstWordList.Items.Add(we.GetWord());
            }
            lblCount.Text = wl.GetCount().ToString();
        }
Ejemplo n.º 8
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     if (bIsUpdated)
     {
         WordEntry we = wl.FindEntry(txtWord.Text);
         if (we != null)
         {
             // Meanings
             String[] strMeanings = txtMeanings.Lines;
             we.ClearMeanings();
             foreach (String str in strMeanings)
             {
                 if (str.Length > 0)
                 {
                     we.AddMeaning(str);
                 }
             }
             // Usages
             String[] strUsages = txtUsages.Lines;
             we.ClearUsages();
             foreach (String str in strUsages)
             {
                 if (str.Length > 0)
                 {
                     we.AddUsage(str);
                 }
             }
             // Other info
             String[] strOther = txtOtherInfo.Lines;
             we.ClearOtherInfo();
             foreach (String str in strOther)
             {
                 if (str.Length > 0)
                 {
                     we.AddOtherInfo(str);
                 }
             }
         }
     }
     btnUpdate.Enabled = false;
     FormMaintenance.GetInstance().GetGREMasterInstance().GetSerializer().SetChanged(true);
 }
Ejemplo n.º 9
0
 private void TestMode_FormClosed(object sender, FormClosedEventArgs e)
 {
     FormMaintenance.GetInstance().UnregisterTestMode();
     FormMaintenance.GetInstance().GetGREMasterInstance().Show();
 }