private void button4_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.CloseDevice(ref _file, textBox3.Text); }
private void button5_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.OpenDevice(textBox3.Text, out _file); }
private void button6_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.StopService(textBox4.Text); }
private void button7_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.RunDriver(textBox4.Text); }
private void button3_Click(object sender, EventArgs e) { var data = new byte[8]; ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.Read(textBox3.Text, ref data, 8); Print(data[0].ToString("X") + data[1].ToString("X") + data[2].ToString("X") + data[3].ToString("X")); }
private void button2_Click(object sender, EventArgs e) { var data = new[] { (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n', (byte)'o', (byte)'p' }; ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); manager.Write(textBox3.Text, ref data, 16); Print(data[0].ToString("X") + data[1].ToString("X") + data[2].ToString("X") + data[3].ToString("X")); }
private void button12_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var manager = new ScManager(printDelegate); var inBuf = textBox5.Text; var outBuf = new byte[8]; Print("Deleting device"); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x801, 0, 0), ref outBuf, in inBuf); Print("Device deleted"); }
private void button11_Click(object sender, EventArgs e) { ScManager.PrintDelegate printDelegate = Print; var outBuf = new byte[8]; var inBuf = "abcdefghijklmnop"; var manager = new ScManager(printDelegate); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x800, 0, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x801, 1, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x802, 2, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x803, 3, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x804, 0, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x805, 1, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x806, 2, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); manager.SendCodes(textBox3.Text, CTL_CODE(0x00008301, 0x807, 3, 0), ref outBuf, in inBuf); Print(outBuf[0].ToString("X") + outBuf[1].ToString("X") + outBuf[2].ToString("X") + outBuf[3].ToString("X")); }