Beispiel #1
0
        private void btn_new_session_Click(object sender, EventArgs e)
        {
            if (rich_Original.TextLength > 0 | rich_Translated.TextLength > 0)
            {
                SaveThis();
            }
            List <string> Sessions = TranslationTools.GetSessionNames();
            string        name     = TextBox_SessionName.Text;

            if (name.Length < 3 | name.Length > 15)
            {
                MessageBox.Show("Write a name with:\nmore than 2 letters and less than 16");
                return;
            }
            for (int i = 0; i < Sessions.Count; i++)
            {
                if (Sessions[i].Equals(name, StringComparison.CurrentCultureIgnoreCase))
                {
                    MessageBox.Show(Name + " already exists choose another");
                    return;
                }
            }
            CloneList(myList, tempList);
            int Id;

            for (int i = 0; i < myList.Count; i++)
            {
                TranslationTools.InsertImagePath(myList[i]);
                Id = TranslationTools.GetLastId();            //gets the inserted ID of InsertImagePath
                TranslationTools.InsertSession(name, Id);     //creates a session
                TranslationTools.InsertScript(myList[i], Id); //associates the Id of the images table to the text
            }
            TranslationTools.FillDropDownSessions("SELECT DISTINCT NameSession from Session;", comboSession);
        }       //debuged
Beispiel #2
0
 private void btn_delete_session_Click(object sender, EventArgs e)
 {
     if (comboSession.SelectedItem == null)
     {
         MessageBox.Show("Select a session");
         return;
     }
     TranslationTools.DeleteSession(comboSession.Text);
     TranslationTools.FillDropDownSessions("SELECT DISTINCT NameSession from Session;", comboSession);
 }
Beispiel #3
0
        private static System.Threading.Timer _timer;//https://www.c-sharpcorner.com/blogs/how-to-run-a-timer-on-specific-time-interval

        public ModifyText()
        {
            InitializeComponent();
            assistant        = new TypeAssistant();
            assistant.Idled += assistant_Idled;
            TranslationTools.FillDropDownSessions("SELECT DISTINCT NameSession from Session;", comboSession);

            _timer = new System.Threading.Timer(x => { callTimerMethode(); }, null, Timeout.Infinite, Timeout.Infinite);
            Setup_Timer();
            updateTextBox();
        }
Beispiel #4
0
 private void pictureBox3_Click(object sender, EventArgs e)
 {
     TranslationTools.FillDropDownSessions("SELECT DISTINCT NameSession from Session;", comboSession);
 }