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


C# IWriter.WriteUTF16方法代码示例

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


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

示例1: WritePatchInfo

		private static void WritePatchInfo(Patch patch, ContainerWriter container, IWriter writer)
		{
			container.StartBlock("titl", 2); // Version 2

			// Write target map info
			writer.WriteInt32(patch.MapID);
			if (patch.MapInternalName != null)
				writer.WriteAscii(patch.MapInternalName);
			else
				writer.WriteByte(0);

			// Write patch info
			writer.WriteUTF16(patch.Name);
			writer.WriteUTF16(patch.Description);
			writer.WriteUTF16(patch.Author);

			// Write screenshot
			if (patch.Screenshot != null)
			{
				writer.WriteInt32(patch.Screenshot.Length);
				writer.WriteBlock(patch.Screenshot);
			}
			else
			{
				writer.WriteInt32(0);
			}

			// Write meta info
			writer.WriteUInt32(patch.MetaPokeBase);
			writer.WriteSByte((sbyte) patch.MetaChangesIndex);

			// Write output name
			if (patch.OutputName != null)
				writer.WriteAscii(patch.OutputName);
			else
				writer.WriteByte(0);

			container.EndBlock();
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:39,代码来源:AssemblyPatchWriter.cs

示例2: WritePatchInfo

        private static void WritePatchInfo(Patch patch, IWriter writer)
        {
            long startPos = writer.Position;
            writer.WriteInt32(AssemblyPatchBlockID.Titl);
            writer.WriteUInt32(0); // Size filled in later
            writer.WriteByte(0); // Version 0

            writer.WriteInt32(patch.MapID);
            if (patch.MapInternalName != null)
                writer.WriteAscii(patch.MapInternalName);
            else
                writer.WriteByte(0);
            writer.WriteUTF16(patch.Name);
            writer.WriteUTF16(patch.Description);
            writer.WriteUTF16(patch.Author);
            if (patch.Screenshot != null)
            {
                writer.WriteInt32(patch.Screenshot.Length);
                writer.WriteBlock(patch.Screenshot);
            }
            else
            {
                writer.WriteInt32(0);
            }

            // Fill in the block size
            long endPos = writer.Position;
            writer.SeekTo(startPos + 4);
            writer.WriteUInt32((uint)(endPos - startPos));
            writer.SeekTo(endPos);
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:31,代码来源:AssemblyPatchWriter.cs

示例3: WritePatchInfo

        private static void WritePatchInfo(Patch patch, IWriter writer)
        {
            var startPos = WriteBlockHeader(writer, AssemblyPatchBlockID.Titl);
            writer.WriteByte(1); // Version 1

            // Write target map info
            writer.WriteInt32(patch.MapID);
            if (patch.MapInternalName != null)
                writer.WriteAscii(patch.MapInternalName);
            else
                writer.WriteByte(0);

            // Write patch info
            writer.WriteUTF16(patch.Name);
            writer.WriteUTF16(patch.Description);
            writer.WriteUTF16(patch.Author);

            // Write screenshot
            if (patch.Screenshot != null)
            {
                writer.WriteInt32(patch.Screenshot.Length);
                writer.WriteBlock(patch.Screenshot);
            }
            else
            {
                writer.WriteInt32(0);
            }

            // Write meta info
            writer.WriteUInt32(patch.MetaPokeBase);
            writer.WriteSByte((sbyte)patch.MetaChangesIndex);

            EndBlock(writer, startPos);
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:34,代码来源:AssemblyPatchWriter.cs


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