Example #1
0
        public static bool Display(FieldsEditorViewModel context, Window owner = null)
        {
            TextFileReadFieldsEditor window = new TextFileReadFieldsEditor(context);

            window.Owner = owner ?? Application.Current.MainWindow;
            return(window.ShowDialog() ?? false);
        }
Example #2
0
        public void EditValue(Property property, object designer)
        {
            var fieldsEditorViewModel = new FieldsEditorViewModel(property.GetValue <TextFileReaderFields>());
            var textFileReadDesigner  = (TextFileReadDesigner)designer;

            fieldsEditorViewModel.SkipHeaderLines = textFileReadDesigner.SkipHeaderLines;
            fieldsEditorViewModel.SkipFooterLines = textFileReadDesigner.SkipFooterLines;

            if (TextFileReadFieldsEditor.Display(fieldsEditorViewModel))
            {
                property.Value = fieldsEditorViewModel.UpdatedFields;
                textFileReadDesigner.SkipHeaderLines = fieldsEditorViewModel.SkipHeaderLines;
                textFileReadDesigner.SkipFooterLines = fieldsEditorViewModel.SkipFooterLines;
            }
        }