Exemplo n.º 1
0
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            //Epi.ImportExport.TableToFormDataConverter tfc = new ImportExport.TableToFormDataConverter(project, destinationView, sourceDriver, tableName, columnNames, columnMapping);
            //tfc.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(tfc_SetMaxProgressBarValue);
            //tfc.SetProgressBar += new SetProgressBarDelegate(tfc_SetProgressBar);
            //tfc.SetStatus += new UpdateStatusEventHandler(tfc_SetStatus);
            //tfc.CheckForCancellation += new CheckForCancellationHandler(tfc_CheckForCancellation);
            //tfc.DoConversion();

            Epi.ImportExport.TableToFormMetadataConverter metadataConverter = new Epi.ImportExport.TableToFormMetadataConverter(project, destinationViewName, sourceDriver, tableName, columnMapping);
            metadataConverter.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(dataConverter_SetMaxProgressBarValue);
            metadataConverter.SetProgressBar         += new SetProgressBarDelegate(dataConverter_SetProgressBar);
            metadataConverter.SetStatus            += new UpdateStatusEventHandler(dataConverter_SetStatus);
            metadataConverter.CheckForCancellation += new CheckForCancellationHandler(dataConverter_CheckForCancellation);
            metadataConverter.Convert();

            View view = project.Views[destinationViewName];

            view.SetTableName(view.Name);

            project.CollectedData.CreateDataTableForView(view, 1);

            Epi.ImportExport.TableToFormDataConverter dataConverter = new Epi.ImportExport.TableToFormDataConverter(project, view, sourceDriver, tableName, columnMapping);
            dataConverter.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(dataConverter_SetMaxProgressBarValue);
            dataConverter.SetProgressBar         += new SetProgressBarDelegate(dataConverter_SetProgressBar);
            dataConverter.SetStatus            += new UpdateStatusEventHandler(dataConverter_SetStatus);
            dataConverter.CheckForCancellation += new CheckForCancellationHandler(dataConverter_CheckForCancellation);
            dataConverter.Convert();
            dataConverter.Dispose();
        }
        void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            //Epi.ImportExport.TableToFormDataConverter tfc = new ImportExport.TableToFormDataConverter(project, destinationView, sourceDriver, tableName, columnNames, columnMapping);
            //tfc.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(tfc_SetMaxProgressBarValue);
            //tfc.SetProgressBar += new SetProgressBarDelegate(tfc_SetProgressBar);
            //tfc.SetStatus += new UpdateStatusEventHandler(tfc_SetStatus);
            //tfc.CheckForCancellation += new CheckForCancellationHandler(tfc_CheckForCancellation);
            //tfc.DoConversion();

            Epi.ImportExport.TableToFormMetadataConverter metadataConverter = new Epi.ImportExport.TableToFormMetadataConverter(project, destinationViewName, sourceDriver, tableName, columnMapping);
            metadataConverter.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(dataConverter_SetMaxProgressBarValue);
            metadataConverter.SetProgressBar += new SetProgressBarDelegate(dataConverter_SetProgressBar);
            metadataConverter.SetStatus += new UpdateStatusEventHandler(dataConverter_SetStatus);
            metadataConverter.CheckForCancellation += new CheckForCancellationHandler(dataConverter_CheckForCancellation);
            metadataConverter.Convert();

            View view = project.Views[destinationViewName];

            view.SetTableName(view.Name);

            project.CollectedData.CreateDataTableForView(view, 1);

            Epi.ImportExport.TableToFormDataConverter dataConverter = new Epi.ImportExport.TableToFormDataConverter(project, view, sourceDriver, tableName, columnMapping);
            dataConverter.SetMaxProgressBarValue += new SetMaxProgressBarValueDelegate(dataConverter_SetMaxProgressBarValue);
            dataConverter.SetProgressBar += new SetProgressBarDelegate(dataConverter_SetProgressBar);
            dataConverter.SetStatus += new UpdateStatusEventHandler(dataConverter_SetStatus);
            dataConverter.CheckForCancellation += new CheckForCancellationHandler(dataConverter_CheckForCancellation);
            dataConverter.Convert();
            dataConverter.Dispose();
        }