Esempio n. 1
0
            internal Task Write(RuntimeComposition runtimeComposition, ComposableCatalog catalog, CachedComposition cacheManager)
            {
                return(Runtime.RunInMainThread(async() => {
                    IdeApp.Exiting += IdeApp_Exiting;

                    saveTask = Task.Run(async() => {
                        try {
                            await WriteMefCache(runtimeComposition, catalog, cacheManager);
                        } catch (Exception ex) {
                            exceptionHandler.HandleException("Failed to write MEF cache", ex);
                        }
                    });
                    await saveTask;

                    IdeApp.Exiting -= IdeApp_Exiting;
                    saveTask = null;
                }));
            }
            internal Task Write(RuntimeComposition runtimeComposition, ComposableCatalog catalog, CachedComposition cacheManager)
            {
                return(Runtime.RunInMainThread(async() => {
                    IdeApp.Exiting += IdeApp_Exiting;

                    saveTask = Task.Run(async() => {
                        try {
                            cachingFaultInjector?.FaultWritingComposition();
                            await WriteMefCache(runtimeComposition, catalog, cacheManager);
                        } catch (Exception ex) {
                            DeleteFiles();

                            Runtime.RunInMainThread(() => {
                                exceptionHandler.HandleException("Failed to write MEF cache", ex);
                            }).Ignore();
                        }
                    });
                    await saveTask;

                    IdeApp.Exiting -= IdeApp_Exiting;
                    saveTask = Task.CompletedTask;
                }));
            }