示例#1
0
        private void InitialiseScreenComponents()
        {
            DefinitionFiles = new ObservableCollection <ListBoxPair>();
            DefinitionFiles.Add(new ListBoxPair {
                Key = "0", Value = "(Select a definition)"
            });

            foreach (var file in CSVConvertorFileManagement.GetDefinitionFiles(CSVAppFolderMapping, ".xml"))
            {
                DefinitionFiles.Add(new ListBoxPair(file, file));
            }

            DefinitionFileList.DisplayMemberPath = "Value";
            DefinitionFileList.SelectedValuePath = "Key";
            DefinitionFileList.ItemsSource       = DefinitionFiles;

            DefinitionFileList.SelectedIndex = 0;

            MappingFiles = new ObservableCollection <ListBoxPair>();
            MappingFiles.Add(new ListBoxPair {
                Key = "0", Value = "(Select a mapping)"
            });

            foreach (var file in CSVConvertorFileManagement.GetMappingFiles(CSVAppFolderMapping, ".xml"))
            {
                MappingFiles.Add(new ListBoxPair(file, file));
            }
            MappingFileList.DisplayMemberPath = "Value";
            MappingFileList.SelectedValuePath = "Key";
            MappingFileList.ItemsSource       = MappingFiles;

            MappingFileList.SelectedIndex = 0;

            SetFilterSelectors();
        }
示例#2
0
        private void InitialiseScreenComponents()
        {
            //  definition files combo
            // load existing file list

            List <ListBoxPair> definitionFilePairs = new List <ListBoxPair>();

            definitionFilePairs.Add(new ListBoxPair("0", "(new)"));

            foreach (var file in CSVConvertorFileManagement.GetDefinitionFiles(CSVAppFolderOptions, ".xml"))
            {
                definitionFilePairs.Add(new ListBoxPair(file, file));
            }

            DefinitionFileList.DisplayMemberPath = "Value";
            DefinitionFileList.SelectedValuePath = "Key";

            DefinitionFileList.ItemsSource = definitionFilePairs;

            //  field type combo
            var datatTypeList = EnumExtractor.GetValueFromDescription <MiddlewareDataType>();

            FieldTypeSelector.ItemsSource       = datatTypeList;
            FieldTypeSelector.DisplayMemberPath = "Value";
            FieldTypeSelector.SelectedValuePath = "Key";

            //  special types combo
            var specialTypeList = EnumExtractor.GetValueFromDescription <MiddlewareSpecialType>();

            SpecialTypeSelector.ItemsSource       = specialTypeList;
            SpecialTypeSelector.DisplayMemberPath = "Value";
            SpecialTypeSelector.SelectedValuePath = "Key";

            var fixedValueList = EnumExtractor.GetValueFromDescription <MiddlewareFixedValue>();

            FixedValueSelector.ItemsSource       = fixedValueList;
            FixedValueSelector.DisplayMemberPath = "Value";
            FixedValueSelector.SelectedValuePath = "Key";

            //  panels
            FieldListButtonsPanel.IsEnabled = false;
            FieldItemsPanel.IsEnabled       = false;

            //  buttons
            EditCreateFieldsButton.IsEnabled = false;

            //  field items
            ClearFieldItemsPanel();

            definitionListBox.ItemsSource  = null;
            DefinitionFileNameTextBox.Text = string.Empty;

            // variables
            DefinitionFields = new ObservableCollection <MiddlewareField>();
        }