Exemplo n.º 1
0
        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));
            });
        }
Exemplo n.º 2
0
            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(';'));
            }
Exemplo n.º 3
0
 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);
 }