예제 #1
0
 private void novyButton_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(jmenoTextBox.Text))
     {
         MessageBox.Show("Jméno není vyplněno.", "Chyba", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
     else
     {
         Pes = new Pes(jmenoTextBox.Text, DateTime.Now);
         Close();
     }
 }
예제 #2
0
        private void novyButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(jmenoTextBox.Text))
            {
                MessageBox.Show("Jméno není vyplněno.", "Chyba", MessageBoxButtons.OK,
                MessageBoxIcon.Error);

            }
            else
            {
                Pes = new Pes(jmenoTextBox.Text, DateTime.Now);
                Close();
            }
        }
예제 #3
0
        private void nacistToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                using (FileStream fs = new FileStream(openFileDialog.FileName, FileMode.Open))
                {
                    XmlSerializer xs = new XmlSerializer(typeof(Pes));
                    pes = (Pes)xs.Deserialize(fs);
                }
            }
            Random random = new Random();

            pes.Nalada = (byte)random.Next(0, 100);
        }
예제 #4
0
        private void novyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NovyDialog dlg = new NovyDialog())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    pes = dlg.Pes;
                    Prepis();
                }

                pes = dlg.Pes;

                if (pes != null)
                {
                    Prepis();
                }
            }
        }
예제 #5
0
파일: Form1.cs 프로젝트: pepiczech/INPTP
        private void novyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NovyDialog dlg = new NovyDialog())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    pes = dlg.Pes;
                    Prepis();
                }

                pes = dlg.Pes;

                if (pes != null)
                {
                    Prepis();
                }
            }
        }
예제 #6
0
파일: Form1.cs 프로젝트: pepiczech/INPTP
        private void nacistToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                using (FileStream fs = new FileStream(openFileDialog.FileName, FileMode.Open))
                {
                    XmlSerializer xs = new XmlSerializer(typeof(Pes));
                    pes = (Pes)xs.Deserialize(fs);
                }

            }
            Random random = new Random();
            pes.Nalada = (byte) random.Next(0, 100);
        }