예제 #1
0
        protected override bool ShouldEatException(Exception generatedException)
        {
            this.CloseSplashScreens();
            if (generatedException.StackTrace.Contains("Microsoft.Expression.Framework.FileResourceManager.LoadObject"))
            {
                return(false);
            }
            InvalidOperationException operationException   = generatedException as InvalidOperationException;
            InvalidCastException      invalidCastException = generatedException as InvalidCastException;

            if (generatedException is NotSupportedException || generatedException.StackTrace.Contains("System.Windows.Media.Imaging.BitmapSource.UpdateBitmapSourceResource") || generatedException is AnimationException || (generatedException is DivideByZeroException && generatedException.StackTrace.Contains("MS.Internal.PtsHost.PtsPage.UpdateBottomlessPage") || (generatedException.StackTrace.Contains("System.Windows.UIElement.Measure") || generatedException.StackTrace.Contains("System.Windows.UIElement.Arrange"))) || (generatedException.StackTrace.Contains("System.Windows.UIElement.OnRender") || generatedException.StackTrace.Contains("System.Windows.Media.Animation.TimeManager.Tick") || generatedException.StackTrace.Contains("System.Windows.BroadcastEventHelper.BroadcastLoadedEvent") || (operationException != null && generatedException.StackTrace.Contains("System.Windows.FrameworkElement.ChangeLogicalParent") || operationException != null && generatedException.StackTrace.Contains("System.Windows.Media.MediaContext.RenderMessageHandler"))) || (operationException != null && generatedException.StackTrace.Contains("System.Windows.Media.MediaContext.NotifyPartitionIsZombie") || (generatedException.StackTrace.Contains("System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream") || generatedException is XamlParseException) || (this.IsDataException(generatedException) || generatedException is WebException) || (generatedException is IOException && generatedException.StackTrace.Contains("System.Windows.Navigation.NavigationService.DoNavigate") && generatedException.StackTrace.Contains("MS.Internal.AppModel.ResourcePart.GetStreamCore") || operationException != null && generatedException.StackTrace.Contains("MS.Internal.Documents.UndoService.Clear") && generatedException.StackTrace.Contains("System.Windows.Controls.TextBox.OnTextPropertyChanged"))) || (generatedException is ResourceReferenceKeyNotFoundException && generatedException.StackTrace.Contains("MS.Internal.Helper.FindResourceHelper.DoTryCatchWhen") || generatedException is NullReferenceException && generatedException.StackTrace.Contains("System.Windows.Data.BindingExpression.get_DynamicConverter") || operationException != null && generatedException.StackTrace.Contains("System.Windows.Markup.Primitives.MarkupWriter.VerifyTypeIsSerializable") && generatedException.StackTrace.Contains("System.Windows.Documents.TextTreeDeleteContentUndoUnit.CopyObjectNode") || (invalidCastException != null && generatedException.StackTrace.Contains("System.Windows.Controls.TextBlock.CoerceText") || generatedException.StackTrace.Contains("MS.Internal.Text.DynamicPropertyReader.GetCultureInfo") && generatedException.StackTrace.Contains("MS.Internal.PtsHost.PtsHost.FormatLine") || operationException != null && generatedException.StackTrace.Contains("System.Windows.Data.ListCollectionView.PrepareLocalArray") && generatedException.StackTrace.Contains("System.Array.SorterObjectArray.SwapIfGreaterWithItems")) || (operationException != null && generatedException.StackTrace.Contains("System.Windows.Controls.ItemsControl.OnItemsSourceChanged") && generatedException.StackTrace.Contains("System.Windows.Controls.ItemCollection.SetItemsSource") || invalidCastException != null && generatedException.StackTrace.Contains("System.Windows.Navigation.JournalEntryListConverter.Convert") || (operationException != null && generatedException.StackTrace.Contains("System.Windows.WeakEventManager.Purge") && generatedException.StackTrace.Contains("System.Windows.LostFocusEventManager.StopListening") || (BlendApplication.IsDispatcherException(generatedException) || BlendApplication.IsSilverlightObjectDisposedException(generatedException) || this.IsUserException(generatedException))))) || generatedException is FileNotFoundException && generatedException.StackTrace.Contains("System.Windows.Controls.SoundPlayerAction"))
            {
                return(true);
            }
            if (generatedException.InnerException != null)
            {
                return(this.ShouldEatException(generatedException.InnerException));
            }
            return(false);
        }
예제 #2
0
 protected override bool ShouldTerminateOnException(DispatcherUnhandledExceptionEventArgs generatedExceptionArguments)
 {
     return(base.ShouldTerminateOnException(generatedExceptionArguments) || BlendApplication.IsSilverlightObjectDisposedException(generatedExceptionArguments.Exception));
 }
예제 #3
0
        private void OnFirstIdle()
        {
            PerformanceUtility.StartPerformanceSequence(PerformanceEvent.StartupCacheWarmUp);
            PerformanceUtility.EndPerformanceSequence(PerformanceEvent.PostingFirstIdleandCallingApplicationRun);
            ICommandLineService service1 = this.Services.GetService <ICommandLineService>();

            this.CloseWelcomeSplashScreen();
            ILicenseService service2 = this.Services.GetService <ILicenseService>();

            BlendApplication.InitializeLicensingDialogResource(service2);
            if (!(service2 is LicenseService) || !LicensingDialogHelper.EnsureProductIsLicensed(this.Services, 0))
            {
                this.Shutdown(-1);
            }
            else
            {
                this.MainWindow.IsEnabled = true;
                this.MainWindow.Focus();
                if (service1.GetArguments("PerfTest") != null)
                {
                    string[] arguments = service1.GetArguments("PerfTest");
                    if (arguments.Length == 1)
                    {
                        new PerformanceTester(this.Services).RunTestFile(arguments[0]);
                    }
                }
                else
                {
                    IProjectManager service3 = this.Services.GetService <IProjectManager>();
                    service3.InitializeRecentProjects();
                    if (this.Services.GetService <IFeedbackService>().ShouldPromptAtStartup)
                    {
                        new FeedbackOptionsCommand(this.Services).Execute();
                    }
                    BlendSdkHelper.PromptUserForMissingSdk(this.Services);
                    this.ShowMefComposeError();
                    bool     flag      = true;
                    string[] arguments = service1.GetArguments(string.Empty);
                    if (arguments == null || arguments.Length != 1)
                    {
                        IConfigurationObject configurationObject = this.Services.GetService <IConfigurationService>()["WindowService"];
                        if (configurationObject != null)
                        {
                            object property = configurationObject.GetProperty("SkipWelcomeScreen");
                            if (property != null && property is bool && (bool)property)
                            {
                                flag = false;
                            }
                        }
                    }
                    if (service1.GetArgument("SkipWelcomeScreen") != null || this.TestingStartup)
                    {
                        flag = false;
                    }
                    service3.InitializeFromKnownProjects((string[])null);
                    if (flag && service3.CurrentSolution == null)
                    {
                        WelcomeScreen.Show(this.Services);
                    }
                }
                string[] arguments1 = service1.GetArguments("actions");
                if (arguments1 != null && arguments1.Length == 1)
                {
                    new ActionProcessor().ProcessActionFile(arguments1[0], this.Services);
                }
                this.Services.GetService <SplashService>().UpdateSplashVersion(service2);
            }
        }