当前位置: 首页>>代码示例>>C#>>正文


C# IPluginHost.Get_TempFolder方法代码示例

本文整理汇总了C#中IPluginHost.Get_TempFolder方法的典型用法代码示例。如果您正苦于以下问题:C# IPluginHost.Get_TempFolder方法的具体用法?C# IPluginHost.Get_TempFolder怎么用?C# IPluginHost.Get_TempFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPluginHost的用法示例。


在下文中一共展示了IPluginHost.Get_TempFolder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Get_DecompressedFiles

        public static sFolder Get_DecompressedFiles(string txtFile, int num, IPluginHost pluginHost)
        {
            String[] files = File.ReadAllLines(txtFile);
            sFolder decompressed = new sFolder();
            decompressed.files = new List<sFile>();

            String currFolder = files[0].Substring((pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar).Length);
            currFolder = currFolder.Substring(0, currFolder.IndexOf(Path.DirectorySeparatorChar));
            String relativePath = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + currFolder;
            currFolder = "";

            decompressed = Recursive_GetDirectories(relativePath, decompressed);

            return decompressed;
        }
开发者ID:MetLob,项目名称:tinke,代码行数:15,代码来源:Helper.cs

示例2: SoundControl

        public SoundControl(SoundBase sb, IPluginHost pluginHost)
        {
            InitializeComponent();

            this.soundBase = sb;
            this.pluginHost = pluginHost;

            this.wav_file = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + Path.GetRandomFileName();
            soundBase.Save_WAV(wav_file, false);
            if (soundBase.CanLoop)
            {
                wav_loop_file = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + Path.GetRandomFileName();
                soundBase.Save_WAV(wav_loop_file, true);
            }

            checkLoop.Enabled = soundBase.CanLoop;
            btnImport.Enabled = soundBase.CanEdit;

            ReadLanguage();
            Information();
        }
开发者ID:MetLob,项目名称:tinke,代码行数:21,代码来源:SoundControl.cs

示例3: BMPControl

        public BMPControl(string image, int id, IPluginHost pluginHost)
        {
            InitializeComponent();
            this.pluginHost = pluginHost;
            this.id = id;

            string imagePath = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + "bmp_" + Path.GetFileName(image);
            File.Copy(image, imagePath, true);
            picBox.ImageLocation = imagePath;

            //ReadLanguage();
        }
开发者ID:MetLob,项目名称:tinke,代码行数:12,代码来源:BMPControl.cs

示例4: Pack

        public static String Pack(string original_file, ref sFolder unpacked, IPluginHost pluginHost)
        {
            String fileOut = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + "new_" + Path.GetFileName(original_file);
            BinaryWriter bw = new BinaryWriter(File.OpenWrite(fileOut));
            BinaryReader br = new BinaryReader(File.OpenRead(original_file));

            // Write header
            bw.Write(br.ReadBytes(0x10));

            // Write pointer table
            uint offset = (uint)unpacked.files.Count * 0x30 + 0x10;
            uint[] offset_files = new uint[unpacked.files.Count];
            for (int i = 0; i < unpacked.files.Count; i++)
            {
                offset_files[i] = offset;
                bw.Write(br.ReadBytes(0x18));   // File name and extension
                bw.Write(unpacked.files[i].size);
                bw.Write(offset);
                offset += unpacked.files[i].size;

                br.BaseStream.Seek(8, SeekOrigin.Current);
                bw.Write(br.ReadBytes(0x10));   // Unknown values
            }
            bw.Flush();
            br.Close();

            // Write file data
            for (int i = 0; i < unpacked.files.Count; i++)
            {
                br = new BinaryReader(File.OpenRead(unpacked.files[i].path));
                br.BaseStream.Position = unpacked.files[i].offset;

                bw.Write(br.ReadBytes((int)unpacked.files[i].size));
                bw.Flush();
                br.Close();

                sFile newFile = unpacked.files[i];
                newFile.offset = offset_files[i];
                newFile.path = fileOut;
                unpacked.files[i] = newFile;
            }
            bw.Flush();
            bw.Close();

            return fileOut;
        }
开发者ID:MetLob,项目名称:tinke,代码行数:46,代码来源:RESC.cs

示例5: Compress

        public static String Compress(string fileIn, string originalFile, IPluginHost pluginHost)
        {
            String fileOut = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + "new_" + Path.GetFileName(originalFile);

            // Read unknown header
            BinaryReader br = new BinaryReader(File.OpenRead(originalFile));
            byte[] header = br.ReadBytes(0x10);
            br.Close();

            BinaryWriter bw = new BinaryWriter(File.OpenWrite(fileOut));
            bw.Write(header);

            // Compress the file with LZ11
            String tempFile = Path.GetTempFileName();
            pluginHost.Compress(fileIn, tempFile, FormatCompress.LZ11);
            bw.Write(File.ReadAllBytes(tempFile));
            bw.Flush();
            bw.Close();

            File.Delete(tempFile);
            return fileOut;
        }
开发者ID:MetLob,项目名称:tinke,代码行数:22,代码来源:LZS.cs

示例6: Unpack

        public static sFolder Unpack(string file, IPluginHost pluginHost)
        {
            DPK.pluginHost = pluginHost;
            String packFile = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + "pack_" + Path.GetFileName(file);
            File.Copy(file, packFile, true);

            BinaryReader br = new BinaryReader(File.OpenRead(file));
            sFolder unpacked = new sFolder();
            unpacked.files = new List<sFile>();

            uint num_files = br.ReadUInt32();

            for (int i = 0; i < num_files; i++)
            {
                sFile newFile = new sFile();
                newFile.name = br.ReadUInt32().ToString() + ".bin";
                newFile.offset = br.ReadUInt32();
                newFile.size = br.ReadUInt32();
                newFile.path = packFile;

                // For Summon Night X Tears Crown game
                if (file.ToUpper().EndsWith("CBT.DPK") ||
                    file.ToUpper().EndsWith("CFL.DPK") ||
                    file.ToUpper().EndsWith("CFN.DPK") ||
                    file.ToUpper().EndsWith("ILLUEST.DPK"))
                        newFile.name += ".dpk";
                // Get the file extension
                //long pos = br.BaseStream.Position;
                //br.BaseStream.Position = newFile.offset;
                //newFile.name += new String(br.ReadChars(4));
                //br.BaseStream.Position = pos;

                unpacked.files.Add(newFile);
            }

            br.Close();
            return unpacked;
        }
开发者ID:MetLob,项目名称:tinke,代码行数:38,代码来源:DPK.cs

示例7: Unpack

        public static sFolder Unpack(string file, IPluginHost pluginHost)
        {
            String packFile = pluginHost.Get_TempFolder() + Path.DirectorySeparatorChar + "unpack_" + Path.GetFileName(file);
            File.Copy(file, packFile, true);

            BinaryReader br = new BinaryReader(File.OpenRead(file));
            sFolder unpacked = new sFolder();
            unpacked.files = new List<sFile>();

            char[] type = br.ReadChars(4);
            uint num_files = br.ReadUInt32();
            uint unknown1 = br.ReadUInt32();
            uint unknown2 = br.ReadUInt32();

            for (int i = 0; i < num_files; i++)
            {
                sFile newFile = new sFile();
                newFile.name = new String(br.ReadChars(0x08)).Replace("\0", "");
                newFile.name += '.' + new String(br.ReadChars(0x08)).Replace("\0", "");
                newFile.name += '.' + new String(br.ReadChars(0x08)).Replace("\0", "");
                newFile.size = br.ReadUInt32();
                newFile.offset = br.ReadUInt32();
                newFile.path = packFile;

                ulong unknown3 = br.ReadUInt64();
                uint unknown4 = br.ReadUInt32();
                uint unknown5 = br.ReadUInt32();

                unpacked.files.Add(newFile);
            }

            br.Close();
            return unpacked;
        }
开发者ID:MetLob,项目名称:tinke,代码行数:34,代码来源:RESC.cs


注:本文中的IPluginHost.Get_TempFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。