void DataGridViewCellClick(object sender, DataGridViewCellEventArgs e) { ProductProperties product = productsDataList.ElementAt(dataGridView.CurrentCell.RowIndex); productNameTextBox.Text = product.ProductName; barcodeExampleTextBox.Text = product.BarcodeExample; barcodeMaskTextBox.Text = product.BarcodeMask; firmwareFileTextBox.Text = product.FirmwareFile; nfcFileTextBox.Text = product.NfcFile; }
public ProductProperties GetProduct() { ProductProperties product = new ProductProperties(); product.ProductName = productNameTextBox.Text; product.BarcodeExample = barcodeExampleTextBox.Text.ToUpper(); product.BarcodeMask = barcodeMaskTextBox.Text.ToUpper(); product.FirmwareFile = firmwareFileTextBox.Text; product.NfcFile = nfcFileTextBox.Text; return(product); }
public void LoadProperties() { List <string> propertyFileLines = File.ReadAllLines(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\settings.ini").ToList(); foreach (string prop in propertyFileLines) { ProductProperties product = new ProductProperties(); string[] data = prop.Split(new string[] { "||" }, StringSplitOptions.None); if (data.Length == 5) { product.ProductName = data[0]; product.BarcodeExample = data[1]; product.BarcodeMask = data[2]; product.FirmwareFile = data[3]; product.NfcFile = data[4]; productsDataList.Add(product); } else { MessageBox.Show("Please check settings.ini file! There should not be empty or incorrect filled lines!"); } } }