public static void Init() { IEngineSubSystem subSystem; Program.Core.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_FILE_SYSTEM, out subSystem); IMainFileSystem mainFileSystem = subSystem as DGLE.IMainFileSystem; String[] registredFileSystems = MarshalUtils.MarshalString((pnt, length) => { mainFileSystem.GetRegisteredVirtualFileSystems(pnt, out length); return(length); }).Split(';').ToList().Where(name => name.Trim().Length > 0).ToArray(); SupportedFileSystems = new Dictionary <string, VirtualFileSystem>(registredFileSystems.Length); registredFileSystems.ToList().ForEach(ext => { IFileSystem fileSystem; mainFileSystem.GetVirtualFileSystem(ext, out fileSystem); string desc = MarshalUtils.MarshalString((pnt, length) => { mainFileSystem.GetVirtualFileSystemDescription(ext, pnt, out length); return(length); }); SupportedFileSystems.Add(ext, new VirtualFileSystem(fileSystem, ext, desc)); }); }
public string[] ListFiles() { Console.WriteLine("List"); string filenames = MarshalUtils.MarshalString((pnt, length) => { fileSystem.ExecuteTextCommandEx("list", pnt, out length); return(length); }); Console.WriteLine(filenames); return(filenames.Split(';')); }
private void GetLastError(TVariant arg) { if ((bool)arg) { LastError = ""; return; } LastError = MarshalUtils.MarshalString((pnt, length) => { fileSystem.ExecuteTextCommandEx("last_error", pnt, out length); return(length); }); Console.WriteLine(LastError); }