Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- namespace LockSaver
- {
- public partial class Form_Saver : Form
- {
- private int _check1 = 0;
- private int _check2 = 0;
- private int _check3 = 0;
- private string[] _tastenkombination;
- private string[] _filePath;
- private int _itemCount;
- private int zaehler = 0;
- private int _time;
- public Form_Saver(string[] _newTastenkombination, int _arrayLaenge, string[] _newFilePath, int _newItemCount, int _newTime)
- {
- InitializeComponent();
- _tastenkombination = new string[_arrayLaenge];
- _tastenkombination = _newTastenkombination;
- _filePath = _newFilePath;
- _itemCount = _newItemCount;
- _time = _newTime;
- //Keys k = (Keys)Enum.Parse(typeof(Keys), _tastenkombination[0]);
- //MessageBox.Show(Convert.ToString(k));
- }
- private void Form_Saver_Load(object sender, EventArgs e)
- {
- FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Bounds = Screen.PrimaryScreen.Bounds;
- Cursor.Hide();
- TopMost = true;
- timerNaechstesBild.Interval = _time*1000;
- timerNaechstesBild.Start();
- pictureBoxSaver.Bounds = Screen.PrimaryScreen.Bounds;
- pictureBoxSaver.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBoxSaver.Image = Image.FromFile(_filePath[zaehler]);
- pictureBoxSaver.SizeMode = PictureBoxSizeMode.StretchImage;
- zaehler++;
- }
- private void Form_Saver_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.A)
- {
- timerInterrupt.Start();
- _check1 = 1;
- }
- if (e.KeyCode == Keys.S)
- {
- timerInterrupt.Start();
- _check2 = 1;
- }
- if (e.KeyCode == Keys.D)
- {
- timerInterrupt.Start();
- _check3 = 1;
- }
- if (e.KeyCode == Keys.RWin)
- {
- e.Handled = true;
- }
- }
- private void timerInterrupt_Tick(object sender, EventArgs e)
- {
- if (_check1 == 1 && _check2 == 1 && _check3 == 1)
- {
- this.Close();
- Cursor.Show();
- Form_Start.ActiveForm.TopMost = true;
- timerInterrupt.Stop();
- timerNaechstesBild.Stop();
- }
- _check1 = 0;
- _check2 = 0;
- _check3 = 0;
- }
- private void timerNaechstesBild_Tick(object sender, EventArgs e)
- {
- try
- {
- pictureBoxSaver.Image = Image.FromFile(_filePath[zaehler]);
- pictureBoxSaver.SizeMode = PictureBoxSizeMode.StretchImage;
- zaehler++;
- if (zaehler == _itemCount)
- {
- zaehler = 0;
- }
- }
- catch
- {
- zaehler++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement