Esempio n. 1
0
        private static void GenerateReloadFileMethod(ICodeBlock currentBlock)
        {
            var reloadFunction = currentBlock
                                 .Function("public static void", "Reload", "object whatToReload");

            var toLoopThrough = ProjectManager.GlueProjectSave.GlobalFiles.Where(item =>
                                                                                 item.IsDatabaseForLocalizing == false && item.LoadedAtRuntime &&
                                                                                 item.IsCsvOrTreatedAsCsv).ToList();

            foreach (var rfs in toLoopThrough)
            {
                var ifInReload = reloadFunction.If("whatToReload == " + rfs.GetInstanceName());
                {
                    ReferencedFileSaveCodeGenerator.GetReload(rfs, null, ifInReload, true, LoadType.MaintainInstance);
                }
            }
        }
Esempio n. 2
0
        private static void GenerateReloadFileMethod(ICodeBlock currentBlock)
        {
            var reloadFunction = currentBlock
                                 .Function("public static void", "Reload", "object whatToReload");

            var toLoopThrough = ProjectManager.GlueProjectSave.GlobalFiles.Where(item =>
                                                                                 // The reason localization databases can't be reloaded is because
                                                                                 // this function is called by passing an object (whatToReload). Localization
                                                                                 // databases don't create an object in GlobalContent, so there's nothing to reload.
                                                                                 // Therefore, the user will have to manually reload
                                                                                 item.IsDatabaseForLocalizing == false &&
                                                                                 item.LoadedAtRuntime &&
                                                                                 GetIfFileCanBeReloaded(item)).ToList();

            foreach (var rfs in toLoopThrough)
            {
                var ifInReload = reloadFunction.If("whatToReload == " + rfs.GetInstanceName());
                {
                    ReferencedFileSaveCodeGenerator.GetReload(rfs, null, ifInReload, LoadType.MaintainInstance);
                }
            }
        }