private void numericUpDown1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { e.SuppressKeyPress = true; numericUpDown1.Visible = false; try { bf = (BlueFinger.GetFactory((int)numericUpDown1.Value, BTZomBFingerFactory.DefaultLoadLocation, BTZomBFingerFactory.DefaultSaveLocation)).GetFinger(); bf.Start(); button1.Enabled = false; button1.Text = "BlueFinger Running"; Settings.Default.TeamNumber = numericUpDown1.Value; Settings.Default.Save(); } catch { button1.Enabled = true; } } }
/// <summary> /// Create a new ZomB FingerServer Factory /// </summary> /// <param name="teamNumber">Your team number</param> /// <param name="from">Path to saved data folder</param> /// <param name="to">Save data to this folder</param> /// <remarks> /// The path should be a reference to a folder that contains all the data files. /// Once all the files are sent, the tag .ZomBarchiveXXX is appended to their file name, where /// XXX is the time ticks. /// The To path works similarly, but .ZomBYYY is appended before the file extension, where /// YYY is the transfer number stored in the file .ZomB in the To path /// </remarks> internal BTZomBFingerFactory(int teamNumber, string from, string to) { //AutoExtractor.Extract(AutoExtractor.Files.InTheHandManaged | AutoExtractor.Files.InTheHandNative); saveTo = to; pullFrom = from; //team GUID, last part is random, don't want to calculate if (teamgid != null) teamgid = new Guid(teamNumber * teamNumber, (short)teamNumber, (short)teamNumber, new byte[] { 0xa1, 0xfc, 0xf7, 0x95, 0x4a, 0x58, 0x6f, 0x25 }); radio = InTheHand.Net.Bluetooth.BluetoothRadio.PrimaryRadio; listen = new BluetoothListener(teamgid); bserve = new BTZomBServer(listen, pullFrom, teamNumber, this); radio.Mode = RadioMode.Connectable; client = new BluetoothClient(); bfinger = new BTFinger(client, saveTo, teamNumber, this); TeamNumber = teamNumber; }