using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;
using System.Xml;
using System.Timers;
using System.Threading;
using Excel = Microsoft.Office.Interop.Excel;

namespace Program
{
    public partial class Form1 : Form
    {
        //static int time = 0;
        //pocitadlo pro radky mereni
        public int i_row=2;
        //static double cas = 0;
        //az 100 mereni
         string[] metoda = new string[200];
         string[] lena = new string[200];
         public string[] lenb = new string[200];
         public string[] lenm = new string[200];
         public string[] caspole = new string[200];
         public string[] pamet = new string[200];
         

        public Form1()
        {
            InitializeComponent();

        }
                
        private void releaseObject(object obj)
        {
              try
              {
                  System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                  obj = null;
              }
              catch (Exception ex)
              {
                  obj = null;
                  MessageBox.Show("Unable to release the Object " + ex.ToString());
              }
              finally
              {
                  GC.Collect();
              }
        }

          

          private void button15_Click(object sender, EventArgs e)
          {
              MyCompany.Client.ClientApp client = new MyCompany.Client.ClientApp();
              string message = "";
              switch (comboBox1.SelectedItem.ToString())
              {
                  case "3. schéma podle Lee-Chiua":
                      message = client.RemoteAutentification_Improved(textBox6.Text, textBox7.Text);
                      break;
                  case "Návrh 4. autentizačního schématu":
                      message = client.RemoteAutentification_nova(textBox6.Text, textBox7.Text, numericUpDown1.Value.ToString());
                      break;
                  case "2. schéma podle Chena, Hsianga a Shiha":
                      message = client.RemoteAutentification_Hsiang(textBox6.Text, textBox7.Text,numericUpDown1.Value.ToString());
                      break;
                  default:
                      message = client.RemoteAutentification_Efficient(textBox6.Text,textBox7.Text);
                      break;
              }
              textBox1.Text += message;
              //MessageBox.Show(message);
          }

          private void button3_Click(object sender, EventArgs e)
          {
              MyCompany.Client.ClientApp client = new MyCompany.Client.ClientApp();
              string message = "";
              switch (comboBox1.SelectedItem.ToString())
              {
                  case "3. schéma podle Lee-Chiua":
                      message = client.Login_Improved(textBox6.Text, textBox7.Text, numericUpDown1.Value.ToString());
                      break;
                  case "Návrh 4. autentizačního schématu":
                      message = client.Login_nova(textBox6.Text, textBox7.Text, numericUpDown1.Value.ToString());
                      break;
                  case "2. schéma podle Chena, Hsianga a Shiha":
                      message = client.Login_Hsiang(textBox6.Text, textBox7.Text,numericUpDown1.Value.ToString());
                      break;
                  default:
                      message = client.Login_Efficient(textBox6.Text, textBox7.Text);
                      break;
              }
              
              textBox1.Text += message;
              //MessageBox.Show(message);
          }

          private void button1_Click(object sender, EventArgs e)
          {
              textBox1.Text = "";
          }

          private void button2_Click(object sender, EventArgs e)
          {
              if (textBox1.Text != "")
              {
                  Clipboard.SetText(textBox1.Text);
              }
          }

          private void label3_Click(object sender, EventArgs e)
          {

          }



    }
}
