예제 #1
0
        private static ProjectInfo UpdateProjectNamespaces(ProjectInfo projectInfo)
        {
            IEnumerable <string> projectFileNames = FileCacheManager.GetSessionFilesInDirectory(projectInfo.ProjectDirectory.FullName, ".cs");

            List <string> usedNamespaces     = new List <string>();
            List <string> notFoundNamespaces = new List <string>();
            List <string> localNamespaces    = new List <string>();

            foreach (string fileName in projectFileNames)
            {
                string sourceCode = FileCacheManager.GetCachedUsingStatement(fileName);

                if (!string.IsNullOrEmpty(sourceCode))
                {
                    List <string> nameSpaces = SourceParser.Parse(sourceCode);
                    if (nameSpaces.Count > 0)
                    {
                        string localNamespace = nameSpaces[0];
                        nameSpaces.RemoveAt(0);
                        usedNamespaces.AddRange(nameSpaces);
                        localNamespaces.Add(localNamespace);
                    }
                }
            }

            // Add unique namespaces
            projectInfo.LocalNamespaces = new List <string>();
            projectInfo.LocalNamespaces.AddRange(localNamespaces.Distinct());
            projectInfo.UsedNamespaces = new List <string>();
            projectInfo.UsedNamespaces.AddRange(usedNamespaces.Distinct());

            return(projectInfo);
        }
        public void LiveLoadTest()
        {
            var cacheManager = new FileCacheManager(logger, new FileSystemAbstraction(), "cache.bin");
            var result       = cacheManager.Load("test");

            cacheManager.TearDown();
        }
예제 #3
0
        private static List <Show> GetShows(ILogger logger)
        {
            var config = Config.GetInstance();
            CacheManagerBase fileCache;

            if (config.TranslatorCacheSettings != null)
            {
                fileCache = new FileCacheManager(config.TranslatorCacheSettings.OutputFile);
            }
            else
            {
                fileCache = new DummyCacheManager();
            }
            var lst = new List <Show>();

            if (config.Grabbers.Count == 0)
            {
                Console.WriteLine("No grabbers defined in config");
            }
            else
            {
                foreach (var grabber in config.Grabbers)
                {
                    try
                    {
                        var a = Assembly.LoadFrom(grabber.Path);
                        foreach (var t in a.GetTypes())
                        {
                            if (t.IsSubclassOf(typeof(GrabberBase)))
                            {
                                var gb    = (GrabberBase)Activator.CreateInstance(t);
                                var shows = gb.Grab(grabber.Parameters, Logger);
                                if (!string.IsNullOrEmpty(grabber.ChannelPrefix))
                                {
                                    shows.ForEach(x => x.Channel = grabber.ChannelPrefix + x.Channel);
                                }
                                if (grabber.Translation != null)
                                {
                                    Logger.WriteEntry("Starting translation of " + t.FullName, LogType.Info);
                                    var g = new GoogleTranslator(fileCache);
                                    g.TranslateShows(shows, grabber.Translation.From, grabber.Translation.To, logger);
                                    Logger.WriteEntry("Finished translation of " + t.FullName, LogType.Info);
                                }
                                lst.AddRange(shows);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteEntry("error on grabber " + grabber.Path + " " + ex.Message, LogType.Error);
                        if (config.HaltOnGrabberError)
                        {
                            throw ex;
                        }
                    }
                }
            }

            return(lst);
        }
예제 #4
0
 public Application(IFileManager googleFileManager, IFileManager localFileManager, FileCacheManager fileCacheManager, MemoryCacheManager memoryCacheManager)
 {
     GoogleManager      = googleFileManager;
     LocalManager       = localFileManager;
     FileCacheManager   = fileCacheManager;
     MemoryCacheManager = memoryCacheManager;
 }
        public void TestRead()
        {
            var manager = new FileCacheManager("cache");
            var root    = GetRadomString();
            var node1   = new Node {
                Id = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString()
            };
            var node2 = new Node {
                Id = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString()
            };
            var child = new Node {
                Id = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString()
            };

            manager.AddOrUpdate(node1, root);
            manager.AddOrUpdate(node2, root);
            manager.AddOrUpdate(child, node1.Id);

            var fromCache = manager.GetIdByNameAndParent(child.Name, node1.Id);

            Assert.AreEqual(child.Id, fromCache);

            //cleanup
            File.Delete("cache");
        }
예제 #6
0
        public static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Unicode;

            try
            {
                Console.WriteLine("========== START ==========");

                var container = new Initializer().RegisterComponents();

                var localManager  = new LocalFileManager();
                var googleManager = new GoogleFileManager(container.Resolve <IGoogleDriveService>());

                // TODO: both cache managers should be singletons. I'm a bit worried about possible issues with race conditions when reading/writing, but I don't think this is something serious here
                var fileCacheManager   = new FileCacheManager("filecache.txt");
                var memoryCacheManager = new MemoryCacheManager();

                var app = new Application(googleManager, localManager, fileCacheManager, memoryCacheManager);
                app.Start();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
예제 #7
0
 /// <summary>
 ///
 /// </summary>
 public SessionFactoryHolder(int cacheRegion)
 {
     _sessionFactories            = new ConcurrentDictionary <Guid, ISessionFactory>();
     _configDictonary             = new ConcurrentDictionary <Guid, NHibernate.Cfg.Configuration>();
     _dataServicesProviderFactory = new DataServicesProviderFactory();
     Logger        = LoggerFactory.GetLog();
     _cacheManager = new FileCacheManager <NHibernate.Cfg.Configuration>(cacheRegion);
 }
예제 #8
0
파일: FileCache.cs 프로젝트: gadfly/nofs
	public FileCache(LogManager log, IMethodFilter methodFilter, FileCacheManager manager, IFileObject file, int blockSize) {
		_log = log;
		_dirty = false;
		_manager = manager;
		_file = file;
		_blockSize = blockSize;
		_methodFilter = methodFilter;
	}
        public void ConstructorTest()
        {
            string path = Path.Combine(Environment.CurrentDirectory, "cache");

            Console.WriteLine("Path {0}", path);
            FileCacheManager ft = new FileCacheManager(path, 200 * 1024 * 1024);

            Assert.IsNotNull(ft);
        }
예제 #10
0
 public TreeNavigator(INode googleRoot, INode localRoot, IFileManager googleFileManager, IFileManager localFileManager, FileCacheManager fileCacheManager)
 {
     GoogleStack = new Stack <INode>();
     LocalStack  = new Stack <INode>();
     GoogleStack.Push(googleRoot);
     LocalStack.Push(localRoot);
     GoogleManager    = googleFileManager;
     LocalManager     = localFileManager;
     FileCacheManager = fileCacheManager;
 }
예제 #11
0
        public void Instance_Always_ReturnSameInstance()
        {
            // Setup
            FileCacheManager manager1 = FileCacheManager.Instance;

            // Call
            FileCacheManager manager2 = FileCacheManager.Instance;

            // Assert
            Assert.AreSame(manager1, manager2);
        }
        public void TestAdd()
        {
            var manager = new FileCacheManager("cache");
            var root    = GetRadomString();

            manager.AddOrUpdate(CreateNodeMoq(), root);

            Assert.IsTrue(File.Exists("cache"));
            Assert.IsTrue(!string.IsNullOrEmpty(File.ReadAllText("cache")));

            //cleanup
            File.Delete("cache");
        }
예제 #13
0
        public void TestRecentlyViewed()
        {
            //Load feed list.
            CacheManager cache   = new FileCacheManager(CACHE_DIR, TimeSpan.MaxValue);
            RssParser    handler = new RssParser(APP_NAME, cache);

            handler.LoadFeedlist(BASE_URL + "LocalTestFeedList.xml", null);
            Assertion.Assert("Feeds should be valid!", handler.FeedsListOK);

            //Grab a feed.
            feedsFeed feed = handler.FeedsTable["http://localhost/RssHandlerTestFiles/LocalTestFeed.xml"];

            //TODO: FeedInfo feedInfo = handler.GetFeedInfo(feed.link);
            //Assertion.AssertNotNull(feedInfo);
            //cache.SaveFeed(feedInfo);

            Assertion.AssertEquals("Rss Bandit Unit Test Feed", feed.title);
            Assertion.AssertEquals(1, feed.storiesrecentlyviewed.Count);

            //Grab feed items
            ArrayList items = handler.GetItemsForFeed(feed);

            Assertion.AssertEquals(2, items.Count);

            //The first one should have been read. the second not.
            NewsItem item = (NewsItem)items[0];

            Assertion.Assert(item.BeenRead);
            item = (NewsItem)items[1];
            Assertion.Assert(!item.BeenRead);

            //So let's read the second item.
            handler.MarkAllCachedItemsAsRead(feed);
            handler.ApplyFeedModifications(feed.link);

            //Let's save this guy.
            using (FileStream newFeedStream = File.OpenWrite(Path.Combine(WEBROOT_PATH, @"RssParserTestFiles\LocalTestFeedList_NEW.xml")))
            {
                //TODO: Ask Dare about RssParser.SaveFeedList()
                //handler.SaveFeedList(newFeedStream, RssFeedListFormat.RssParser);
                newFeedStream.Close();
                Assertion.Assert(File.Exists(Path.Combine(WEBROOT_PATH, @"RssParserTestFiles\LocalTestFeedList_NEW.xml")));
            }

            //Let's reload and see what happens.
            handler = new RssParser(APP_NAME, cache);
            handler.LoadFeedlist(BASE_URL + "LocalTestFeedList_NEW.xml", null);
            feed = handler.FeedsTable["http://localhost/RssHandlerTestFiles/LocalTestFeed.xml"];
            Assertion.AssertEquals("Should be two now.", 2, feed.storiesrecentlyviewed.Count);
        }
예제 #14
0
        public void GetFileCache_FileCacheAlreadyRegistered_ReturnSameFileCache()
        {
            // Setup
            FileCacheManager manager = FileCacheManager.Instance;
            string           path    = TestHelper.GetScratchPadPath(nameof(GetFileCache_FileCacheAlreadyRegistered_ReturnSameFileCache));

            using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), nameof(GetFileCache_FileCacheAlreadyRegistered_ReturnSameFileCache)))
            {
                FileCache fileCache1 = manager.GetFileCache(path);

                // Call
                FileCache fileCache2 = manager.GetFileCache(path);

                // Assert
                Assert.AreSame(fileCache1, fileCache2);
            }
        }
예제 #15
0
        public void GivenFileCache_WhenUnsubscribingAndFileCacheNotUsed_ThenFileCacheDisposed()
        {
            // Given
            FileCacheManager manager = FileCacheManager.Instance;
            string           path    = TestHelper.GetScratchPadPath(nameof(GivenFileCache_WhenUnsubscribingAndFileCacheNotUsed_ThenFileCacheDisposed));

            using (new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), nameof(GivenFileCache_WhenUnsubscribingAndFileCacheNotUsed_ThenFileCacheDisposed)))
            {
                FileCache fileCache1 = manager.GetFileCache(path);

                // When
                manager.UnsubscribeFileCache(fileCache1);
                FileCache fileCache2 = manager.GetFileCache(path);

                // Then
                Assert.AreNotSame(fileCache1, fileCache2);
            }
        }
        public void TestUpdate()
        {
            var manager = new FileCacheManager("cache");
            var root    = GetRadomString();
            var node1   = new Node {
                Id = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString()
            };

            manager.AddOrUpdate(node1, root);
            node1.Name = GetRadomString();
            manager.AddOrUpdate(node1, root);

            var id = manager.GetIdByNameAndParent(node1.Name, root);

            Assert.AreEqual(node1.Id, id);

            //cleanup
            File.Delete("cache");
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="configCenterService"></param>
 /// <param name="topicVistors"></param>
 /// <param name="queueVistors"></param>
 public MqListenerFactoryThreadService(
     IMqConfigService configCenterService,
     IConfigCenterMqListenerService listenerService,
     IEnumerable <IMqCommandTopicVistor> topicVistors,
     IEnumerable <IMqCommandQuqueVistor> queueVistors)
 {
     _listenerAppId = ProcessLockHelper.GetProcessLockId();
     _configCenterMqListenerService = listenerService;
     _cacheManager             = new FileCacheManager <ConcurrentDictionary <int, MqInstanceInfo> >((int)CacheRegionName.FileMqDeleteInstace);
     this._configCenterService = configCenterService;
     _topicVistors             = topicVistors;
     _queueVistors             = queueVistors;
     _serviceList          = new ConcurrentDictionary <int, MqListenerService>();
     _delInstanceInfos     = new ConcurrentDictionary <int, MqInstanceInfo>();
     _excuteInfoDictionary = new ConcurrentDictionary <string, ExcuteInfo>();
     Stoped   += OnStoped;
     Stoping  += OnStoping;
     Starting += OnStarting;
 }
예제 #18
0
        public void RenderToFile(string filename, bool overwrite, Encoding encoding)
        {
            FileMode fm;

            try
            {
                if (!overwrite && File.Exists(filename))
                {
                    fm = FileMode.Append;
                }
                else
                {
                    fm = FileMode.Create;

                    if (!Directory.Exists(Path.GetDirectoryName(filename)))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(filename));
                    }
                }

                currentFilename = filename;
                FileCacheManager.WriteFile(filename, RenderToString(), fm, encoding);
            }
            catch (System.IO.PathTooLongException ex)
            {
                string errorText = string.Format(" The path and/or the filename is too long!\n\n" +
                                                 "Error occured in TemplateFile:\t\t{0}\n\n" +
                                                 "Error when trying to create the directory and/or file:\n" +
                                                 "Filename ({2} chars):\t\t{1}\n" +
                                                 "Path ({4} chars):\t{3}\n" +
                                                 "Total Length of Filename + Path:\t{5} chars\n\n" +
                                                 "Original Exception:\n{6}"
                                                 , this.GetType().Name
                                                 , Path.GetFileName(filename)
                                                 , Path.GetFileName(filename).Length.ToString()
                                                 , filename.Substring(0, filename.LastIndexOf("\\") + 1)
                                                 , filename.Substring(0, filename.LastIndexOf("\\") + 1).Length.ToString()
                                                 , (Path.GetFileName(filename).Length + filename.Substring(0, filename.LastIndexOf("\\") + 1).Length).ToString()
                                                 , ex.ToString());

                throw new System.IO.PathTooLongException(errorText);
            }
        }
예제 #19
0
        public void Test_Serialization()
        {
            IStockDataDataSource     stockDataDataSource     = new ReutersDataSource();
            IPricesDataSource        pricesDataSource        = new YahooDataSource();
            IOptionChainDataSource   optionChainDataSource   = new NasdaqDataSource();
            IFinancialDataSource     financialDataSource     = new NasdaqDataSource();
            IRiskFreeRatesDataSource riskFreeRatesDataSource = null;
            IAssetTypeDataSource     assetTypeDataSource     = null;
            IStatisticsDataSource    statisticsDataSource    = null;
            IIndexesDataSource       indexesDataSource       = null;
            ICacheManager            cacheManager            = new FileCacheManager();

            IDataSource dataSource = new DataSourceDispatcher(stockDataDataSource, pricesDataSource, optionChainDataSource, financialDataSource, riskFreeRatesDataSource, assetTypeDataSource, statisticsDataSource, indexesDataSource, cacheManager);
            bool        ok         = dataSource.TryGetCompleteAssetData("AAPL", Common.Entities.Exchange.NASDAQ, AssetClass.Stock, true, true, out AssetBase asset, out string message);

            Assert.IsTrue(ok);
            string    json = JsonConvert.SerializeObject(asset);
            AssetBase a    = JsonConvert.DeserializeObject <AssetBase>(json);
        }
예제 #20
0
        private void ThreadWork(object state)
        {
            try
            {
                try
                {
                    using (new SessionScope(MetaManagerServices.GetSessionFactory(), MetaManagerServices.GetDomainInterceptor(), true, FlushMode.Never, true))
                    {
                        ((DataAccess.DomainInterceptor)MetaManagerServices.GetDomainInterceptor()).GetDataFromConfigurationManagement = true;

                        generateStartTime = DateTime.Now;

                        var selectedServices = (from id in (List <string>) state
                                                select modelService.GetDomainObject <Service>(Guid.Parse(id))).ToList();

                        // Get which business entities we need to generate depending on the selected services.
                        Dictionary <Guid, BusinessEntity> entityDictionary = new Dictionary <Guid, BusinessEntity>();

                        //Dictionary<Guid, IDomainObject> loadedObjects = new Dictionary<Guid, IDomainObject>();
                        List <Service> loadedServices = new List <Service>();

                        foreach (Service service in selectedServices)
                        {
                            //Service loadedService = (Service)loadedObjects[service.Id];
                            Service loadedService = modelService.GetDomainObject <Service>(service.Id);

                            loadedServices.Add(loadedService);

                            foreach (ServiceMethod method in loadedService.ServiceMethods)
                            {
                                if (method != null)
                                {
                                    if (!entityDictionary.ContainsKey(method.MappedToAction.BusinessEntity.Id))
                                    {
                                        entityDictionary.Add(method.MappedToAction.BusinessEntity.Id, method.MappedToAction.BusinessEntity);
                                    }
                                }
                            }
                        }

                        ApplicationTemplate template = new ApplicationTemplate();
                        template.entities           = entityDictionary.Values.ToList <BusinessEntity>();
                        template.services           = loadedServices;
                        template.solutionFileName   = Path.Combine(solutionPathTbx.Text, solutionNameTbx.Text + ".sln");
                        template.referenceDirectory = referencePathTbx.Text;
                        template.templateCallback   = CodeSmithTemplateCallback;

                        template.Render(TextWriter.Null);

                        UpdateStatusAndTime("Done!", 0, 0, 0);
                    }

                    string info = string.Format("Code generation complete.\r\n{0} files generated, {1} files written to disk", FileCacheManager.GetWrites(), FileCacheManager.GetWritesToDisk());


                    if (this.InvokeRequired)
                    {
                        this.Invoke(new System.Action(() =>
                        {
                            ShowGenerationResult.Show(this, "Generation Result", info, "Files written to disk", FileCacheManager.GetWrittenFilesToDisk());
                        })
                                    );
                    }
                    else
                    {
                        ShowGenerationResult.Show(this, "Generation Result", info, "Files written to disk", FileCacheManager.GetWrittenFilesToDisk());
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), "Error in Codegeneration", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                ((DataAccess.DomainInterceptor)MetaManagerServices.GetDomainInterceptor()).GetDataFromConfigurationManagement = false;

                if (this.InvokeRequired)
                {
                    this.Invoke(new System.Action(() =>
                    {
                        Cursor.Current    = Cursors.Default;
                        pProgress.Visible = false;
                        EnableDisableButtons();
                    })
                                );
                }
                else
                {
                    Cursor.Current    = Cursors.Default;
                    pProgress.Visible = false;
                    EnableDisableButtons();
                }
            }
        }
예제 #21
0
 private void AddToCache(INode nodeToBackup, string parentId)
 {
     FileCacheManager.AddOrUpdate(nodeToBackup, parentId);
 }
예제 #22
0
 private string GetFromCache(string nodeName, string parentId)
 {
     return(FileCacheManager.GetIdByNameAndParent(nodeName, parentId));
 }
예제 #23
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckPaths())
                {
                    return;
                }

                okBtn.Enabled             = false;
                cancelBtn.Enabled         = false;
                btnStopGeneration.Enabled = true;
                doBreak = false;

                Cursor.Current = Cursors.WaitCursor;

                // Save to config file
                Config.Backend.XMLSchemaFolder    = tbXMLSchemaFolder.Text;
                Config.Backend.PLSQLPackageFolder = tbPLSQLPackageFolder.Text;
                Config.Save();

                try
                {
                    // Reset progressbar and make the panel visible
                    progressBar.Value   = 0;
                    pProgress.Visible   = true;
                    lblTimeElapsed.Text = string.Empty;

                    lblProgressText.Text = "Extracting Data from Database...";
                    System.Windows.Forms.Application.DoEvents();

                    using (new SessionScope(MetaManagerServices.GetSessionFactory(), MetaManagerServices.GetDomainInterceptor(), true, FlushMode.Never, true))
                    {
                        IList <Report> reports = new List <Report>();

                        List <IDomainObject> selectedReports = modelService.GetAllDomainObjectsByApplicationId <Report>(BackendApplication.Id).OrderBy(r => (r.Name)).ToList <IDomainObject>();

                        foreach (Report report in selectedReports)
                        {
                            Report readReport = modelService.GetDomainObject <Report>(report.Id);
                            reports.Add(readReport);
                        }

                        ReportTemplate template = new ReportTemplate();

                        // Create the plsql body and spec directories if they don't exist
                        string plsqlBodyDirectory = Path.Combine(tbPLSQLPackageFolder.Text.Trim(), "body");
                        string plsqlSpecDirectory = Path.Combine(tbPLSQLPackageFolder.Text.Trim(), "spec");

                        if (!Directory.Exists(plsqlBodyDirectory))
                        {
                            Directory.CreateDirectory(plsqlBodyDirectory);
                        }

                        if (!Directory.Exists(plsqlSpecDirectory))
                        {
                            Directory.CreateDirectory(plsqlSpecDirectory);
                        }

                        template.reports                  = reports;
                        template.xsdDirectory             = tbXMLSchemaFolder.Text.Trim();
                        template.plsqlBodyDirectory       = plsqlBodyDirectory;
                        template.plsqlSpecDirectory       = plsqlSpecDirectory;
                        template.printDocumentPackageName = "PrintDocument"; // Name of package for printing document
                        template.templateCallback         = CodeSmithTemplateCallback;

                        generateStartTime = DateTime.Now;

                        template.Render(TextWriter.Null);

                        UpdateTime();
                    }

                    if (FileCacheManager.GetFilesNotSaved().Count > 0)
                    {
                        string notSavedFiles = FileCacheManager.GetFilesNotSaved().Aggregate((current, next) => current + Environment.NewLine + '\t' + next);

                        string txt = "There were one or more files that couldn't be saved.\r\n" +
                                     "Probable cause is that the file is located in a dynamic Clearcase view and is not checked out.\r\n" +
                                     "Check out the file(s) and generate again.";

                        ShowGenerationResult.Show(this, "Generation Result: Not saved files", txt, "Files not saved", FileCacheManager.GetFilesNotSaved());
                    }

                    string text = string.Format("Code generation complete.\r\n{0} files generated, {1} files written to disk.",
                                                FileCacheManager.GetWrites(),
                                                FileCacheManager.GetWritesToDisk());

                    ShowGenerationResult.Show(this, "Generation Result", text, "Files written to disk", FileCacheManager.GetWrittenFilesToDisk());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), "Error in Codegeneration", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                Cursor.Current    = Cursors.Default;
                pProgress.Visible = false;
                EnableDisableButtons();
            }
        }
 /// <summary>
 ///
 /// </summary>
 protected SyncTableMqCommandQuqueVistorBase()
 {
     _logger       = LoggerFactory.GetLog();
     _cacheManager = new FileCacheManager <MqCommandInfo>((int)CacheRegionName.FileMqQuqueError);
 }
예제 #25
0
        private void ThreadWork(object state)
        {
            try
            {
                generateStartTime = DateTime.Now;

                var selectedModules = (from id in (List <string>) state
                                       select modelService.GetDomainObject <Domain.Module>(Guid.Parse(id))).ToList();

                string referencePath           = referencePathTbx.Text;
                string solutionFileNameAndPath = Path.Combine(solutionPathTbx.Text, solutionNameTbx.Text + ".sln");

                modelService.GenerateFrontendFromGUI(selectedModules.ToList <Domain.Module>(), FrontendApplication, solutionFileNameAndPath, referencePath);

                UpdateStatusAndTime("Done!", 0, 0, 0);

                string info = string.Format("Code generation complete.\r\n{0} files generated, {1} files written to disk", FileCacheManager.GetWrites(), FileCacheManager.GetWritesToDisk());

                if (this.InvokeRequired)
                {
                    this.Invoke(new System.Action(() =>
                    {
                        ShowGenerationResult.Show(this, "Generation Result", info, "Files written to disk", FileCacheManager.GetWrittenFilesToDisk());
                    })
                                );
                }
                else
                {
                    ShowGenerationResult.Show(this, "Generation Result", info, "Files written to disk", FileCacheManager.GetWrittenFilesToDisk());
                }
            }
            finally
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new System.Action(() =>
                    {
                        Cursor.Current    = Cursors.Default;
                        pProgress.Visible = false;
                        EnableDisableButtons();
                    })
                                );
                }
                else
                {
                    Cursor.Current    = Cursors.Default;
                    pProgress.Visible = false;
                    EnableDisableButtons();
                }
            }
        }