public static LModule Load(string file_name) { //TODO- LError support (?), verify existence before-hand ? if(_modules.ContainsKey(file_name)) { WeakReference weakref = _modules[file_name]; if(weakref.IsAlive) return weakref.Target as LModule; } IntPtr handle = lt_module_load(file_name); if(handle == IntPtr.Zero) throw new ArgumentException("file_name"); LModule module = new LModule(handle); _modules.Add(file_name, new WeakReference(module)); return module; }
static Global() { //TODO- Decide whether this should be in Application.Init() or not. lt_type_init(); BaseModule = LModule.Load(BaseLib); }