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


C# IFile.ReadText方法代码示例

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


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

示例1: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string importPath = GetFolder(rootPath);

            string importFilePath = System.IO.Path.Combine(importPath, INDEX_FILE_NAME);
            string fontIndexListJson = fileSystem.ReadText(importFilePath);
            _data = JsonConvert.DeserializeObject<Data>(fontIndexListJson);

            foreach(int fontIndex in _data.fontIndexList)
            {
                string elementPath = System.IO.Path.Combine(importPath, fontIndex.ToString());
                string fontElementJson = fileSystem.ReadText(elementPath);
                FontElement fontElement = JsonConvert.DeserializeObject<FontElement>(fontElementJson);
                _fontElementList.Add(fontElement);
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:16,代码来源:Font.cs

示例2: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string importRoot = GetFolder(rootPath);
            string importFilePath = System.IO.Path.Combine(importRoot, INDEX_FILENAME);
            string content = fileSystem.ReadText(importFilePath);

            _data = JsonConvert.DeserializeObject<Data>(content);
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:8,代码来源:Gen8.cs

示例3: Import

        public void Import(IFile fileSystem,
                           string extraFontFolderPath,
                           string indexFilename)
        {
            string indexPath = System.IO.Path.Combine(extraFontFolderPath, indexFilename);
            string indexJsonContent = fileSystem.ReadText(indexPath);

            List<int> extraFontIndexList = new List<int> { 2 };
            patchDict = new Dictionary<int, Font.FontElement>();

            foreach (int exfontIndex in extraFontIndexList)
            {
                string exfontFilePath = System.IO.Path.Combine(extraFontFolderPath, exfontIndex.ToString());
                string exfontContent = fileSystem.ReadText(exfontFilePath);
                Font.FontElement fontElement = JsonConvert.DeserializeObject<Font.FontElement>(exfontContent);
                patchDict.Add(exfontIndex, fontElement);
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:18,代码来源:ExtraFont.cs

示例4: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFullPath = System.IO.Path.Combine(folderPath, INDEX_FILENAME);
            string jsonContent = fileSystem.ReadText(indexFullPath);
            _data = JsonConvert.DeserializeObject<Data>(jsonContent);

            foreach(var textureFilename in _data.exportedImageNameList)
            {
                elementList.Add(fileSystem.ReadBinary(System.IO.Path.Combine(folderPath, textureFilename)));
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:12,代码来源:Txtr.cs

示例5: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFullPath = System.IO.Path.Combine(folderPath, INDEX_FILENAME);
            string stringList = fileSystem.ReadText(indexFullPath);

            string[] lines = stringList.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            for(int i = 0; i < lines.Length;i++)
            {
                _data.stringList.Add(new StringEntry() { index = i, content = lines[i] });
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:12,代码来源:Strg.cs

示例6: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string importPath = GetFolder(rootPath);
            string indexFilePath = System.IO.Path.Combine(importPath, INDEX_FILENAME);
            string indexString = fileSystem.ReadText(indexFilePath);
            _data = JsonConvert.DeserializeObject<Data>(indexString);

            foreach(var filename in _data.audioFileNameList)
            {
                string audioPath = System.IO.Path.Combine(importPath, filename);
                audioList.Add(fileSystem.ReadBinary(audioPath));
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:13,代码来源:Audo.cs

示例7: Import

        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFilePath = System.IO.Path.Combine(folderPath, GetIndexFilename());
            string indexJson = fileSystem.ReadText(indexFilePath);
            List<NamedElementFilename> namedElementFilenameList = JsonConvert.DeserializeObject<List<NamedElementFilename>>(indexJson);

            foreach (var namedElementFilename in namedElementFilenameList)
            {
                string filePath = System.IO.Path.Combine(folderPath, namedElementFilename.filename);
                elementList.Add
                (
                    new NamedElement
                    {
                        name = namedElementFilename.name,
                        content = fileSystem.ReadBinary(filePath)
                    }
                );
            }
        }
开发者ID:FrankNine,项目名称:Heartache,代码行数:20,代码来源:SingleNamedArrayChunk.cs


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