From 43fe9dd08af6ea19eddeaf90f6a407a3efd2ac32 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 13 Sep 2009 14:49:47 +0000 Subject: [PATCH] Trying to fix the build (why is the XAML compiler so fragile?) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4920 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../UsageDataCollector/AnalyticsMonitor.cs | 20 +++++++++++++------ .../UsageDataCollector/CollectedDataView.xaml | 2 +- .../CollapsiblePanel.cs | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs b/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs index a885f5d8ca..1a75258a00 100644 --- a/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs +++ b/src/AddIns/Misc/UsageDataCollector/AnalyticsMonitor.cs @@ -33,12 +33,20 @@ namespace ICSharpCode.UsageDataCollector } set { PropertyService.Set("ICSharpCode.UsageDataCollector.Enabled", value.ToString()); - if (value) { - Instance.OpenSession(); - } else { - Instance.CloseSession(); - Instance.TryDeleteDatabase(); - } + // Initially opening the session takes some time; which is bad for the startpage + // because the animation would start with a delay. We solve this by calling Open/CloseSession + // on a background thread. + ThreadPool.QueueUserWorkItem(delegate { AsyncEnableDisable(); } ); + } + } + + static void AsyncEnableDisable() + { + if (Enabled) { + Instance.OpenSession(); + } else { + Instance.CloseSession(); + Instance.TryDeleteDatabase(); } } diff --git a/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml b/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml index 82e95d603f..fc1a611a98 100644 --- a/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml +++ b/src/AddIns/Misc/UsageDataCollector/CollectedDataView.xaml @@ -15,7 +15,7 @@ Margin="16,8,16,8" Click="Button_Click" /> \ No newline at end of file diff --git a/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs b/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs index 47f1de87d4..2b0ecc4f13 100644 --- a/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs +++ b/src/Main/ICSharpCode.Core.Presentation/CollapsiblePanel.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.Core.Presentation public static readonly DependencyProperty DurationProperty = DependencyProperty.Register( "Duration", typeof(TimeSpan), typeof(CollapsiblePanel), - new UIPropertyMetadata(TimeSpan.FromMilliseconds(500))); + new UIPropertyMetadata(TimeSpan.FromMilliseconds(250))); /// /// The duration in milliseconds of the animation.