예제 #1
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>();
        }
예제 #2
0
        private void SetFilterSelectors()
        {
            // set filter combos
            var datatTypeList = EnumExtractor.GetValueFromDescription <FilterType>();

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

            //matchTypeSelector
            var datatMatchList = EnumExtractor.GetValueFromDescription <FilterMatchType>();

            matchTypeSelector.ItemsSource       = datatMatchList;
            matchTypeSelector.DisplayMemberPath = "Value";
            matchTypeSelector.SelectedValuePath = "Key";
        }