Пример #1
0
        private void btnConfigureDataFormat_Click(object sender, EventArgs e)
        {
            switch (SelectedDataFormatType)
            {
            case DataFormatTypes.Delimited:
            case DataFormatTypes.FixedLength:
                frmConfig2 config = new frmConfig2(DataSource.Id, DataSource.Name, SelectedDataFormatType);
                if (config.ShowDialog() == DialogResult.OK)
                {
                    RefreshDataSource();
                }
                break;

            case DataFormatTypes.Xml:
                this.Cursor = Cursors.WaitCursor;
                frmConfigXml configXml = new frmConfigXml(DataSource.Id);
                this.Cursor = Cursors.Default;
                if (configXml.ShowDialog() == DialogResult.OK)
                {
                    RefreshDataSource();
                }
                break;

            case DataFormatTypes.EDIX12:
                frmConfigEDI ediConfig = new frmConfigEDI(this.DataSource.Id);
                ediConfig.ShowDialog();
                break;
            }
        }
Пример #2
0
        public override object EditValue(ITypeDescriptorContext context,
                                         IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService wfes = provider.GetService(typeof(IWindowsFormsEditorService)) as
                                              IWindowsFormsEditorService;
            SreDataSourceProperty dsProperty = context.Instance as SreDataSourceProperty;

            if (wfes != null)
            {
                switch (dsProperty.DataFormatType)
                {
                case DataFormatTypes.Delimited:
                case DataFormatTypes.FixedLength:
                    frmConfig2 config = new frmConfig2(dsProperty.Id, dsProperty.Name, dsProperty.DataFormatType);
                    wfes.ShowDialog(config);
                    break;

                case DataFormatTypes.Xml:
                    frmConfigXml configXml = new frmConfigXml(dsProperty.Id);
                    wfes.ShowDialog(configXml);
                    //    this.DataSourceKeys = _Manager.GetKeys(DataSource.Id);
                    break;

                case DataFormatTypes.Zipped:
                    frmConfigZip configzip = new frmConfigZip(dsProperty.Id);
                    wfes.ShowDialog(configzip);
                    //this.DataSourceKeys = _Manager.GetKeys(DataSource.Id);
                    //this.DataSource = new Manager().GetApplicationDetails(DataSource.Id);

                    break;

                case DataFormatTypes.EDIX12:
                    frmConfigEDI ediConfig = new frmConfigEDI(dsProperty.Id);
                    wfes.ShowDialog(ediConfig);
                    break;

                case DataFormatTypes.MultiRecord:
                    ConfigCSharpInputGenerator cSharpConfig = new ConfigCSharpInputGenerator(dsProperty.Id, DataFormatTypes.MultiRecord);
                    wfes.ShowDialog(cSharpConfig);
                    break;

                case DataFormatTypes.CSharpCode:
                    cSharpConfig = new ConfigCSharpInputGenerator(dsProperty.Id, DataFormatTypes.CSharpCode);
                    wfes.ShowDialog(cSharpConfig);
                    break;

                case DataFormatTypes.Sql:
                    MessageBox.Show("No configuration required!", "Configuration Not Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;

                case DataFormatTypes.Custom:
                    return(ShowCustomInterfaceEditor(wfes, dsProperty));

                    break;
                }
            }
            return(value);
        }