コード例 #1
0
ファイル: Form1.cs プロジェクト: edgatas/AutomaticKeyboardLFS
        public mainForm()
        {
            //AllocConsole();

            InitializeComponent();
            FormBorderStyle = FormBorderStyle.FixedSingle;

            IOstrobe loading = new IOstrobe();

            _settings = new Settings(loading);
            _strobe   = new Strobe();
            UpdateUI();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: edgatas/AutomaticKeyboardLFS
        private void loadButton_Click(object sender, EventArgs e)
        {
            string         localPath       = System.IO.Directory.GetCurrentDirectory();
            OpenFileDialog openFileDialog1 = new OpenFileDialog
            {
                Filter           = (@"Text Files (*.txt)|*.txt"),
                InitialDirectory = localPath
            };

            DialogResult result = openFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                string   filePath = openFileDialog1.FileName;
                IOstrobe input    = new IOstrobe();
                input.LoadData(_settings, filePath);
                UpdateUI();
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: edgatas/AutomaticKeyboardLFS
        private void saveButton_Click(object sender, EventArgs e)
        {
            string         localPath       = System.IO.Directory.GetCurrentDirectory();
            SaveFileDialog SaveFileDialog1 = new SaveFileDialog
            {
                FileName         = "settings",
                Filter           = (@"Text Files (*.txt)|*.txt"),
                DefaultExt       = "txt",
                AddExtension     = true,
                InitialDirectory = localPath
            };

            DialogResult result = SaveFileDialog1.ShowDialog();

            if (result == DialogResult.OK)
            {
                string   filePath = SaveFileDialog1.FileName;
                IOstrobe output   = new IOstrobe();
                output.SaveData(_settings, filePath);
            }
        }
コード例 #4
0
        public Settings(IOstrobe io)
        {
            io.LoadData(this, "settings.txt");
            if (!io.IsGood)
            {
                IsOnlyLFS   = true;
                IsHorn      = true;
                IsLights    = true;
                IsOnStateOn = true;

                HornKey = 'B';

                const int t = 200;
                keys  = new[] { '3', '8', '3', '0', '3', '7', '3', '0' };
                sleep = new[] { t, t, t, t, t, t, t, t };
            }
            else
            {
                io.LoadData(this, "settings.txt");
            }
        }