public static void Load(string dir_, string fileName_) { try { Process p = new Process(); p.Load(dir_, fileName_); bool isValid = p.CheckValidity(); if (isValid) { processes.Add(p); activeProcess = p; p.ReadScenesData(); activeProcess = null; GBInfo.WriteLine("Module " + fileName_ + " loaded successfully"); } } catch (GBException e) { throw e; } catch (Exception e) { throw new GBException(GBException.Reason.UnableToLoadModule, e); } }
internal static void ActivateFirstProcess() { if (activeProcess == null && processes.Count > 0) { activeProcess = processes[0]; } else if (activeProcess != null) { GBDebug.WriteLine("There is an active process already"); } else { GBDebug.WriteLine("There is no processes on que list"); } }
public bool Load(Process loadProcess) { string completeDir = loadProcess == null ? string.Empty : loadProcess.BaseDir + "/"; completeDir += fileName; if (GBFileSystem.FileExists(completeDir)) { loaded = LoadImplement(completeDir); return loaded; } return false; }
internal static void UpdateProcesses() { if (finishActiveProcess) { if (activeProcess != null) { activeProcess.rManager.DeleteAllResources(); processes.Remove(activeProcess); activeProcess = null; GC.Collect(); ActivateFirstProcess(); } finishActiveProcess = false; } }