Пример #1
0
        private void showAttributes_Click(object sender, EventArgs e)
        {
            var fileLocation   = sourceFileTextBox.Text;
            var sourceFileType = SourceDataComboBox.Text;

            switch (sourceFileType)
            {
            case "JSON":
                allAttributes = AttributesFromJson.GetJsonAttributes(fileLocation);
                SetAttributesView(allAttributes);
                break;

            case "Excel":
                allAttributes = AttributesFromExcel.GetExcelAttributes(fileLocation);
                SetAttributesViewFromExcel(fileLocation);
                break;

            case "XML":
                allAttributes = AttributesFromXML.GetXMLAttributes(fileLocation);
                SetAttributesView(allAttributes);
                break;

            case "API":
                string sourceUrl = ApiTextBox.Text;
                allAttributes = AttributesFromApi.GetApiAttributes(sourceUrl);
                SetAttributesView(allAttributes);
                break;

            default:
                break;
            }
        }
Пример #2
0
        private void SetAttributesViewFromExcel(string fileLocation)
        {
            var attributes = AttributesFromExcel.GetHeaders(fileLocation);

            foreach (var item in attributes)
            {
                availableListBox.Items.Add(item);
            }
        }