Browse Source

Remove DoEvents from ReportDesigner

pull/2/head
peterforstmeier 15 years ago
parent
commit
2ce0cd79b4
  1. 2
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs
  2. 69
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs

2
src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.Reports.Addin
{ {
Application.UseWaitCursor = true; Application.UseWaitCursor = true;
Application.DoEvents(); // Application.DoEvents();
try { try {
IComponent cc = this.host.CreateComponent(typeof(ICSharpCode.Reports.Addin.Designer.RootReportModel),"RootReportModel"); IComponent cc = this.host.CreateComponent(typeof(ICSharpCode.Reports.Addin.Designer.RootReportModel),"RootReportModel");
ICSharpCode.Reports.Addin.Designer.RootReportModel rootControl = cc as ICSharpCode.Reports.Addin.Designer.RootReportModel; ICSharpCode.Reports.Addin.Designer.RootReportModel rootControl = cc as ICSharpCode.Reports.Addin.Designer.RootReportModel;

69
src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs

@ -170,10 +170,7 @@ namespace ICSharpCode.Reports.Addin
void DesignerLoading(object sender, EventArgs e) void DesignerLoading(object sender, EventArgs e)
{ {
LoggingService.Debug("Forms designer: DesignerLoader loading..."); LoggingService.Debug("Forms designer: DesignerLoader loading...");
// this.reloadPending = false;
this.unloading = false; this.unloading = false;
// this.UserContent = this.pleaseWaitLabel;
Application.DoEvents();
} }
@ -181,12 +178,10 @@ namespace ICSharpCode.Reports.Addin
{ {
// This method is called when the designer has loaded. // This method is called when the designer has loaded.
LoggingService.Debug("Report designer: DesignerLoader loaded, HasSucceeded=" + e.HasSucceeded.ToString()); LoggingService.Debug("Report designer: DesignerLoader loaded, HasSucceeded=" + e.HasSucceeded.ToString());
// this.reloadPending = false;
this.unloading = false; this.unloading = false;
if (e.HasSucceeded) { if (e.HasSucceeded) {
// CreatePanel();
SetupDesignSurface(); SetupDesignSurface();
this.IsFormsDesignerVisible = true; this.IsFormsDesignerVisible = true;
generator.MergeFormChanges(null); generator.MergeFormChanges(null);
@ -255,6 +250,7 @@ namespace ICSharpCode.Reports.Addin
} }
#endregion #endregion
private void MergeFormChanges() private void MergeFormChanges()
{ {
System.Diagnostics.Trace.WriteLine("View:MergeFormChanges()"); System.Diagnostics.Trace.WriteLine("View:MergeFormChanges()");
@ -310,7 +306,6 @@ namespace ICSharpCode.Reports.Addin
#endregion #endregion
#region SelectionService #region SelectionService
private void SelectionChangedHandler(object sender, EventArgs args) private void SelectionChangedHandler(object sender, EventArgs args)
@ -388,67 +383,6 @@ namespace ICSharpCode.Reports.Addin
#region unload Designer
/*
void UnloadDesigner()
{
LoggingService.Debug("FormsDesigner unloading, setting ActiveDesignSurface to null");
designSurfaceManager.ActiveDesignSurface = null;
bool savedIsDirty = (this.DesignerCodeFile == null) ? false : this.DesignerCodeFile.IsDirty;
this.UserContent = this.pleaseWaitLabel;
Application.DoEvents();
if (this.DesignerCodeFile != null) {
this.DesignerCodeFile.IsDirty = savedIsDirty;
}
// We cannot dispose the design surface now because of SD2-451:
// When the switch to the source view was triggered by a double-click on an event
// in the PropertyPad, "InvalidOperationException: The container cannot be disposed
// at design time" is thrown.
// This is solved by calling dispose after the double-click event has been processed.
if (designSurface != null) {
designSurface.Loading -= this.DesignerLoading;
designSurface.Loaded -= this.DesignerLoaded;
designSurface.Flushed -= this.DesignerFlushed;
designSurface.Unloading -= this.DesingerUnloading;
IComponentChangeService componentChangeService = designSurface.GetService(typeof(IComponentChangeService)) as IComponentChangeService;
if (componentChangeService != null) {
componentChangeService.ComponentChanged -= ComponentChanged;
componentChangeService.ComponentAdded -= ComponentListChanged;
componentChangeService.ComponentRemoved -= ComponentListChanged;
componentChangeService.ComponentRename -= ComponentListChanged;
}
if (this.Host != null) {
this.Host.TransactionClosed -= TransactionClose;
}
ISelectionService selectionService = designSurface.GetService(typeof(ISelectionService)) as ISelectionService;
if (selectionService != null) {
selectionService.SelectionChanged -= SelectionChangedHandler;
}
if (disposing) {
designSurface.Dispose();
} else {
WorkbenchSingleton.SafeThreadAsyncCall(designSurface.Dispose);
}
designSurface = null;
}
this.typeResolutionService = null;
this.loader = null;
foreach (KeyValuePair<Type, TypeDescriptionProvider> entry in this.addedTypeDescriptionProviders) {
TypeDescriptor.RemoveProvider(entry.Value, entry.Key);
}
this.addedTypeDescriptionProviders.Clear();
}
*/
#endregion
#region HasPropertyContainer implementation #region HasPropertyContainer implementation
private void UpdatePropertyPad() private void UpdatePropertyPad()
@ -487,6 +421,7 @@ namespace ICSharpCode.Reports.Addin
#endregion #endregion
#region IUnDohandler #region IUnDohandler
#endregion #endregion

Loading…
Cancel
Save