Esempio n. 1
0
        /// <summary>
        /// Read ADIF from clipboard (for example copied from HamRadioDeluxe)
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">event args</param>
        private void ButtonReadClipboardClick(object sender, EventArgs e)
        {
            // Clear old data
            this.dataGridViewAdifItems.Rows.Clear();

            // Evaluate the given ADIF text from clip
            var listOfAdifs = AdifHelper.EvaluateStringAdif(Clipboard.GetText());

            // Add to GridView
            foreach (var adifItem in listOfAdifs)
            {
                this.dataGridViewAdifItems.Rows.Add(
                    new DataGridViewRow
                {
                    Cells =
                    {
                        new DataGridViewTextBoxCell {
                            Value = adifItem.AdifName
                        },
                        new DataGridViewTextBoxCell {
                            Value = adifItem.AdifValue
                        }
                    }
                });
            }
        }
Esempio n. 2
0
        private void ButtonLoadFromClip_Click(object sender, EventArgs e)
        {
            var listOfAdifs = AdifHelper.EvaluateStringAdif(Clipboard.GetText());

            foreach (var adifItem in listOfAdifs)
            {
                var labelItem = labelItemList.Find(x => x.AdifKey == adifItem.AdifName);
                if (labelItem != null)
                {
                    labelItem.CurrentValueString = adifItem.AdifValue;
                }
            }

            this.UpdateDisplayedLabels();
        }