Example #1
0
        //============================================================
        // <T>根据指定模式导出数据到文件。</T>
        //
        // @param modeCd 导出模式
        // @param fileName 文件名称
        //============================================================
        public void ExportFile(ERsExportMode modeCd, string fileName)
        {
            FCompressFile file = new FCompressFile();

            Serialize(file);
            file.Compress(fileName);
            _logger.Debug(this, "Export", "Export model success. (file_name={0})", fileName);
        }
Example #2
0
        //============================================================
        // <T>选中导出事件。</T>
        //
        // @author TYFNG 20120406
        //============================================================
        public void ExportSelected(ERsExportMode modeCd)
        {
            FObjects <FRsResource> resources = qdsCatalog.SeletedResource();

            foreach (FRsResource resource in resources)
            {
                FRsExportTask task = new FRsExportTask();
                task.ModeCd   = modeCd;
                task.Exporter = resource;
                RMoCore.TaskConsole.Push(task);
            }
        }
Example #3
0
 //============================================================
 // <T>根据指定模式导出数据。</T>
 //
 // @param modeCd 导出模式
 //============================================================
 public override void Export(ERsExportMode modeCd)
 {
     // 打开资源
     Open();
     // 压缩文件
     foreach (FDrScene scene in _scenes)
     {
         scene.Export(modeCd);
     }
     _logger.Debug(this, "Export", "Export scene success. (file_name={0})", _exportFileName);
     // 释放资源
     Dispose();
 }
Example #4
0
 //============================================================
 // <T>根据指定模式导出数据。</T>
 //
 // @param modeCd 导出模式
 //============================================================
 public virtual void Export(ERsExportMode modeCd)
 {
     // 打开资源
     Open();
     //// 获得导出路径
     //string exportDirectory = RContent3dManager.ResourceGroupConsole.ExportResourceDirectory;
     //string fileName = exportDirectory + "/r3/" + RString.PadLeft(_code, 6, '0') + ".yrs";
     ////............................................................
     //FCompressFile file = new FCompressFile();
     //Serialize(file, null);
     //file.Compress(fileName);
     //_logger.Debug(this, "Export", "Export resource group. (group={0}, file_name={1})", _code, fileName);
 }
Example #5
0
        //============================================================
        // <T>根据指定模式导出数据。</T>
        //
        // @param modeCd 导出模式
        //============================================================
        public override void Export(ERsExportMode modeCd)
        {
            // 打开资源
            Open();
            //............................................................
            string exportDirectory = RContent2dManager.ResourceConsole.ExportDirectory + "\\sd";
            //............................................................
            FByteFile file = new FByteFile();

            file.LoadFile(_fileName);
            file.SaveFile(exportDirectory + "\\" + Code + ".mp3");
            //............................................................
            _logger.Debug(this, "Export", "Export sound resource. (type_name={0}, code={1})", _typeName, _code);
        }
Example #6
0
        //============================================================
        // <T>根据指定模式导出数据。</T>
        //
        // @param modeCd 导出模式
        //============================================================
        public override void Export(ERsExportMode modeCd)
        {
            // 打开资源
            Open();
            //............................................................
            string exportFileName = RContent3dManager.ThemeConsole.ExportDirectory + "\\" + Code + ".ser";
            //............................................................
            // 序列化数据
            FByteFile file = new FByteFile();

            Serialize(file);
            file.SaveFile(exportFileName);
            //............................................................
            // 释放资源
            Dispose();
            _logger.Debug(this, "Export", "Export theme success. (file_name={0})", exportFileName);
        }
Example #7
0
        //============================================================
        // <T>序列化数据。</T>
        //============================================================
        public override void Export(ERsExportMode modeCd)
        {
            // 打开资源
            Open();
            //............................................................
            string exportFileName = RContent3dManager.SenceConsole.ExportDirectory + "\\" + Code + ".ser";
            //............................................................
            // 序列化数据
            FByteFile file = new FByteFile();

            Serialize(file);
            file.SaveFile(exportFileName);
            //............................................................
            // 释放资源
            Dispose();
            _logger.Debug(this, "Export", "Export model success. (file_name={0})", exportFileName);
            //// 打开资源
            //Open();
            ////............................................................
            //string exportDeflateDirectory = RContent3dManager.ContentConsole.ExportDeflateDirectory + "\\p3.sc";
            //string exportLzmaDirectory = RContent3dManager.ContentConsole.ExportLzmaDirectory + "\\p3.sc";
            //string code = Code;
            //if (_techniqueName != "config") {
            //   code = Code + "." + _techniqueName;
            //}
            ////............................................................
            //// 序列化数据
            //FByteStream stream = new FByteStream();
            //Serialize(stream);
            ////............................................................
            //// 保存Deflate数据
            //using (FRsCompressFile file = new FRsCompressFile(ERsCompress.Deflate, stream, RResourceManager.CompressBlockSplit)) {
            //   byte[] data = file.CompressBytes();
            //   RFile.WriteAllBytes(exportDeflateDirectory + "/sc_" + code + ".swf", data);
            //}
            ////............................................................
            //// 保存LZMA数据
            //using (FRsCompressFile file = new FRsCompressFile(ERsCompress.Lzma, stream, RResourceManager.CompressBlockSplit)) {
            //   byte[] data = file.CompressBytes();
            //   RFile.WriteAllBytes(exportLzmaDirectory + "/sc_" + code + ".swf", data);
            //}
            ////............................................................
            //// 释放资源
            //Dispose();
        }
Example #8
0
        //============================================================
        // <T>根据指定模式导出数据。</T>
        //
        // @param modeCd 导出模式
        //============================================================
        public override void Export(ERsExportMode modeCd)
        {
            // 打开资源
            Open();
            //............................................................
            FRsResourceConsole resourceConsole = RContent2dManager.ResourceConsole;
            string             exportDirectory = resourceConsole.ExportDirectory;
            string             fileName        = exportDirectory + "\\" + _code + ".ser";
            //............................................................
            // 序列化数据
            FByteFile file = new FByteFile();

            Serialize(file);
            file.SaveFile(fileName);
            //............................................................
            // 释放资源
            Dispose();
            _logger.Debug(this, "Export", "Export picture resource. (type_name={0}, code={1})", _typeName, _code);
        }
Example #9
0
 //============================================================
 // <T>导出所有资源。</T>
 //
 // @param modeCd 导出模式
 //============================================================
 public void TaskExportAll(ERsExportMode modeCd)
 {
     // 清除导出目录
     RDirectory.Clear(_exportDirectory);
     // 导出资源
     foreach (FRsResource resource in _resources.Values)
     {
         //if (!resource.OptionExport) {
         //   continue;
         //}
         if (resource is FRsResourcePicture)
         {
             FRsExportTask task = new FRsExportTask();
             task.Exporter = resource;
             task.ModeCd   = modeCd;
             RMoCore.TaskConsole.Push(task);
         }
         if (resource is FRsResourceAnimation)
         {
             FRsExportTask task = new FRsExportTask();
             task.Exporter = resource;
             task.ModeCd   = modeCd;
             RMoCore.TaskConsole.Push(task);
         }
         if (resource is FRsResourceSound)
         {
             FRsExportTask task = new FRsExportTask();
             task.Exporter = resource;
             task.ModeCd   = modeCd;
             RMoCore.TaskConsole.Push(task);
         }
         if (resource is FRsResourceMusic)
         {
             FRsExportTask task = new FRsExportTask();
             task.Exporter = resource;
             task.ModeCd   = modeCd;
             RMoCore.TaskConsole.Push(task);
         }
     }
 }
Example #10
0
        //============================================================
        // <T>根据指定模式导出数据。</T>
        //
        // @param modeCd 导出模式
        //============================================================
        public override void Export(ERsExportMode modeCd)
        {
            // 打开资源
            Open();
            //............................................................
            // 序列化数据
            FByteStream stream = new FByteStream();

            Serialize(stream);
            //............................................................
            //// 保存数据
            //using (FRsCompressFile file = new FRsCompressFile(ERsCompress.Lzma, stream, RContent2dManager.CompressBlockSplit)) {
            //   byte[] data = file.CompressBytes();
            //   string fileName1 = RContent3dManager.TemplateConsole.ExportDirectory + "/tp_" + Code + ".swf";
            //   File.WriteAllBytes(fileName1, data);
            //   string fileName2 = RContent3dManager.ResourceConsole.ExportResourceDirectory + "/tp_" + Code + ".stg";
            //   File.WriteAllBytes(fileName2, data);
            //   _logger.Debug(this, "Export", "Export template success. (file_name={0})", fileName1);
            //}
            //............................................................
            // 释放资源
            Dispose();
        }
Example #11
0
 //============================================================
 // <T>根据指定模式导出数据。</T>
 //
 // @param modeCd 导出模式
 //============================================================
 public virtual void Export(ERsExportMode modeCd)
 {
 }
Example #12
0
 //============================================================
 // <T>构造资源导出任务。<T>
 //
 // @param exporter 导出接口
 // @param modeCd 导出模式
 //============================================================
 public FRsExportTask(IRsExport exporter = null, ERsExportMode modeCd = ERsExportMode.CompressDeflate)
 {
     _exporter = exporter;
     _modeCd   = modeCd;
 }