Beispiel #1
0
        public void RunExportAsync(Stream exportStream, ISpreadExportRenderer exportRenderer)
        {
            this.spreadExportRenderer = exportRenderer;
            if (this.GetWorker().IsBusy)
            {
                throw new Exception("There is an export operation that has not yet finished.");
            }
            List <PropertyGridSpreadExportRow> exportRows = (List <PropertyGridSpreadExportRow>)null;

            if (this.propertyGrid.InvokeRequired)
            {
                this.propertyGrid.Invoke((Delegate)(() =>
                {
                    PropertyGridExportState state = this.SavePropertyGridState();
                    exportRows = this.GetPropertyGridDataSnapshot();
                    this.RestorePropertyGridState(state);
                }));
            }
            else
            {
                PropertyGridExportState state = this.SavePropertyGridState();
                exportRows = this.GetPropertyGridDataSnapshot();
                this.RestorePropertyGridState(state);
            }
            this.GetWorker().RunWorkerAsync((object)new List <object>(2)
            {
                (object)new PropertyGridSpreadExportDataSnapshot(string.Empty, exportRows),
                (object)exportStream
            });
        }
Beispiel #2
0
        public void RunExportAsync(string fileName, ISpreadExportRenderer exportRenderer)
        {
            this.spreadExportRenderer = exportRenderer;
            if (this.GetWorker().IsBusy)
            {
                throw new Exception("There is an export operation that has not yet finished.");
            }
            List <TreeViewSpreadExportRow> exportRows = (List <TreeViewSpreadExportRow>)null;

            if (this.treeView.InvokeRequired)
            {
                this.treeView.Invoke((Delegate)(() =>
                {
                    TreeViewExportState state = this.SaveTreeViewState();
                    exportRows = this.GetTreeViewDataSnapshot();
                    this.RestoreTreeViewState(state);
                }));
            }
            else
            {
                TreeViewExportState state = this.SaveTreeViewState();
                exportRows = this.GetTreeViewDataSnapshot();
                this.RestoreTreeViewState(state);
            }
            this.GetWorker().RunWorkerAsync((object)new TreeViewSpreadExportDataSnapshot(fileName, exportRows));
        }
Beispiel #3
0
 public void RunExportAsync(
     Stream exportStream,
     ISpreadExportRenderer exportRenderer,
     string sheetName)
 {
     this.SheetName = sheetName;
     this.RunExportAsync(exportStream, exportRenderer);
 }
Beispiel #4
0
 public void RunExportAsync(
     string fileName,
     ISpreadExportRenderer exportRenderer,
     string sheetName)
 {
     this.SheetName = sheetName;
     this.RunExportAsync(fileName, exportRenderer);
 }
Beispiel #5
0
 public void RunExport(Stream exportStream, ISpreadExportRenderer exportRenderer)
 {
     this.spreadExportRenderer = exportRenderer;
     this.spreadExportRenderer.RegisterFormatProvider(this.ExportFormat);
     if (this.propertyGrid.InvokeRequired)
     {
         this.applicationDoEvents = true;
         this.propertyGrid.Invoke((Delegate) new PropertyGridSpreadExport.RunExportToStreamCallback(this.RunExportCall), (object)exportStream);
     }
     else
     {
         this.RunExportCall(exportStream);
     }
 }
Beispiel #6
0
 public void RunExport(string fileName, ISpreadExportRenderer exportRenderer)
 {
     this.spreadExportRenderer = exportRenderer;
     this.spreadExportRenderer.RegisterFormatProvider(this.ExportFormat);
     if (this.treeView.InvokeRequired)
     {
         this.applicationDoEvents = true;
         this.treeView.Invoke((Delegate) new TreeViewSpreadExport.RunExportCallback(this.RunExportCall), (object)fileName);
     }
     else
     {
         this.RunExportCall(fileName);
     }
 }