public Arduino_Class(string COM_Port, string BaudRate) { Serial = new SerialPort(COM_Port, int.Parse(BaudRate), Parity.None, 8, StopBits.One); if (Serial.IsOpen != true) { Serial.DataReceived += new SerialDataReceivedEventHandler(Arduino_DataReceived); Serial.Open(); } else { throw new Exception(i18n.__("NFC_No_Com_Port")); } }
private void Arduino_Form_Load(object sender, EventArgs e) { Translate_Class.Translate(this); comboBox1.DataSource = COMPortInfo.GetCOMPortsInfo(); comboBox1.DisplayMember = "Description"; comboBox1.ValueMember = "Name"; if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = 0; comboBox2.SelectedIndex = 3; this.Opacity = 100; } else { MessageBox.Show(i18n.__("AmiiBombuino_No_Com_Port"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }
public PN532_Class(string COM_Port, string BaudRate) { //http://zachsaw.blogspot.fr/2010/07/serialport-ioexception-workaround-in-c.html Serial = new SerialPort(COM_Port, int.Parse(BaudRate), Parity.None, 8, StopBits.One); if (!Serial.IsOpen) { Serial.DataReceived += new SerialDataReceivedEventHandler(PN532_DataReceived); try { Serial.Open(); } catch (Exception) {} } else { throw new Exception(i18n.__("NFC_No_Com_Port")); } }
private void trackBar1_ValueChanged(object sender, EventArgs e) { label3.Text = trackBar1.Value.ToString(); if (trackBar1.Value == 5) { label3.Text += " " + i18n.__("TP_Editor_Run1"); } if (trackBar1.Value == 20) { label3.Text += " " + i18n.__("TP_Editor_Run2"); } if (trackBar1.Value == 40) { label3.Text += " " + i18n.__("TP_Editor_RunAll"); } }
private void Flash_Form_Load(object sender, EventArgs e) { Translate_Class.Translate(this); comboBox3.SelectedIndex = 0; comboBox2.SelectedIndex = 1; comboBox1.DataSource = COMPortInfo.GetCOMPortsInfo(); comboBox1.DisplayMember = "Description"; comboBox1.ValueMember = "Name"; if (comboBox1.Items.Count > 0) { Com_Loaded = true; comboBox1.SelectedIndex = 0; comboBox1_SelectedIndexChanged(this, EventArgs.Empty); this.Opacity = 100; } else { MessageBox.Show(i18n.__("NFC_No_Com_Port"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } if (Action_Write) { button2.Text = i18n.__("NFC_Create_Amiibo_Tag"); } if (!Action_Write) { checkBox1.Visible = false; } }
private void ListFiles(string Dir_Path) { listView1.Invoke(new Action(() => listView1.Items.Clear())); listView1.Invoke(new Action(() => listView1.BeginUpdate())); string[] Files = Directory.GetFiles(Dir_Path, "*.bin"); foreach (string BinFile in Files) { if (new FileInfo(BinFile).Length == 572) { DialogResult DgResult = MessageBox.Show(i18n.__("Message_Amiibo_Hash_Detected", Environment.NewLine), this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (DgResult == DialogResult.Yes) { byte[] Hashed_File = File.ReadAllBytes(Path.Combine(Current_Folder, BinFile)); Array.Resize(ref Hashed_File, 540); File.Move(Path.Combine(Current_Folder, BinFile), Path.Combine(Current_Folder, Path.GetFileNameWithoutExtension(BinFile) + ".bin.bak")); File.WriteAllBytes(Path.Combine(Current_Folder, BinFile), Hashed_File); } } if (new FileInfo(BinFile).Length == 540) { ListViewItem lvItem = new ListViewItem(" " + Path.GetFileName(BinFile), 0); listView1.Invoke(new Action(() => listView1.Items.Add(lvItem))); } } listView1.Invoke(new Action(() => listView1.EndUpdate())); listView1.Invoke(new Action(() => listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent))); listView1.Invoke(new Action(() => listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize))); }
private void PowerSaves_Form_Load(object sender, EventArgs e) { Translate_Class.Translate(this); foreach (HIDDevice.interfaceDetails USB_Device in HIDDevice.getConnectedDevices()) { if (USB_Device.product.Trim() == "NFC-Portal" && USB_Device.manufacturer.Trim() == "Datel") { USBHID_DevicePath = USB_Device.devicePath; label3.Text = USB_Device.product + " of " + USB_Device.manufacturer; textBox1.Text = USB_Device.serialNumber; break; } } if (USBHID_DevicePath == "") { MessageBox.Show(i18n.__("PowerSaves_No_PowerSaves"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { this.Opacity = 100; } }
public static void Translate(Main_Form Form) { //Main Menu //--------- //File Menu Form.fileToolStripMenuItem.Text = i18n.__("Menu_File"); Form.selectbinFolderToolStripMenuItem.Text = i18n.__("Menu_Select_Amiibo_Folder"); Form.dumpAmiiboToolStripMenuItem.Text = i18n.__("Menu_Dump_Amiibo"); Form.amiiBombuinoToolStripMenuItem.Text = i18n.__("Menu_Dump_AmiiBombuino"); Form.powerSavesToolStripMenuItem.Text = i18n.__("Menu_Dump_PowerSaves"); Form.flashAmiiBombuinoToolStripMenuItem.Text = i18n.__("Menu_Flash_AmiiBombuino"); Form.internalFlasherToolStripMenuItem.Text = i18n.__("Menu_Internal_Flasher"); Form.withXLoaderToolStripMenuItem.Text = i18n.__("Menu_XLoader"); Form.quitToolStripMenuItem.Text = i18n.__("Menu_Quit"); //Options Menu Form.optionsToolStripMenuItem.Text = i18n.__("Menu_Options"); Form.keyToolStripMenuItem.Text = i18n.__("Menu_Keys"); Form.selectKeybinFileToolStripMenuItem.Text = i18n.__("Menu_Select_Amiibo_Keys"); Form.whereFindAmiiboKeyToolStripMenuItem.Text = i18n.__("Menu_Where_Find_Keys"); Form.registerAmiiboKeyToolStripMenuItem.Text = i18n.__("Menu_Check_Keys_Clipboard"); Form.filesCacheToolStripMenuItem.Text = i18n.__("Menu_Files_Cache"); Form.activeFilesCachingToolStripMenuItem.Text = i18n.__("Menu_Active_Cache"); Form.deleteCacheToolStripMenuItem.Text = i18n.__("Menu_Delete_Cache"); Form.websiteInformationsToolStripMenuItem.Text = i18n.__("Menu_Amiibo_Databases"); Form.searchToolStripMenuItem.Text = i18n.__("Menu_Search"); Form.languagesToolStripMenuItem.Text = i18n.__("Menu_Languages"); //Help Menu Form.helpToolStripMenuItem.Text = i18n.__("Menu_Help"); Form.howConnectToolStripMenuItem.Text = i18n.__("Menu_How_Connect"); Form.aboutToolStripMenuItem.Text = i18n.__("Menu_About"); Form.donateToolStripMenuItem.Text = i18n.__("Menu_Donate"); //Amiibo Menu Form.amiiboToolStripMenuItem.Text = i18n.__("Menu_Amiibo_Menu"); Form.moreInformationsToolStripMenuItem.Text = i18n.__("Menu_Amiibo_More_Informations") + "..."; Form.actionsToolStripMenuItem.Text = "..." + i18n.__("Menu_Amiibo_Action"); Form.decryptToolStripMenuItem.Text = i18n.__("Menu_Amiibo_Decrypt"); Form.createTagToolStripMenuItem.Text = i18n.__("Menu_Amiibo_CreateTag"); Form.dumpAppDataToolStripMenuItem.Text = i18n.__("Menu_Amiibo_Dump_AppData"); Form.writeAppDataToolStripMenuItem.Text = i18n.__("Menu_Amiibo_Write_AppData"); Form.appDataEditorToolStripMenuItem.Text = i18n.__("Menu_Amiibo_AppData_Editor"); Form.deleteFileToolStripMenuItem.Text = i18n.__("Menu_Delete_File"); //ListView //-------- ((ColumnHeader)Form.listView1.Columns[0]).Text = i18n.__("Table_Column_File"); Form.textBox1.Text = i18n.__("Search"); }