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


C# BinaryWriter.WriteInt32方法代码示例

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


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

示例1: WriteTo

		public void WriteTo(BinaryWriter writer)
		{
			writer.Write(this.ProjectFileName);
			writer.Write(this.Target);
			writer.WriteInt32((int)eventMask);
			
			writer.WriteInt32(properties.Count);
			foreach (var pair in properties) {
				writer.Write(pair.Key);
				writer.Write(pair.Value);
			}
			
			writer.WriteInt32(interestingTaskNames.Count);
			foreach (string taskName in interestingTaskNames)
				writer.Write(taskName);
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:16,代码来源:BuildJob.cs

示例2: EncodeBlockTxNode

 public static void EncodeBlockTxNode(BinaryWriter writer, BlockTxNode blockTx)
 {
     writer.WriteInt32(blockTx.Index);
     writer.WriteInt32(blockTx.Depth);
     writer.WriteUInt256(blockTx.Hash);
     writer.WriteBool(blockTx.Pruned);
     if (!blockTx.Pruned)
         writer.WriteBytes(blockTx.TxBytes.ToArray());
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:9,代码来源:DataEncoder.cs

示例3: EncodeTxLookupKey

 public static void EncodeTxLookupKey(BinaryWriter writer, TxLookupKey txLookupKey)
 {
     writer.WriteUInt256(txLookupKey.BlockHash);
     writer.WriteInt32(txLookupKey.TxIndex);
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:5,代码来源:DataEncoder.cs

示例4: EncodeSpentTx

 public static void EncodeSpentTx(BinaryWriter writer, SpentTx spentTx)
 {
     writer.WriteUInt256(spentTx.TxHash);
     writer.WriteInt32(spentTx.ConfirmedBlockIndex);
     writer.WriteInt32(spentTx.TxIndex);
     writer.WriteInt32(spentTx.OutputCount);
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:7,代码来源:DataEncoder.cs

示例5: EncodeUnspentTx

 public static void EncodeUnspentTx(BinaryWriter writer, UnspentTx unspentTx)
 {
     writer.WriteUInt256(unspentTx.TxHash);
     writer.WriteInt32(unspentTx.BlockIndex);
     writer.WriteInt32(unspentTx.TxIndex);
     writer.WriteUInt32(unspentTx.TxVersion);
     writer.WriteBool(unspentTx.IsCoinbase);
     writer.WriteVarBytes(unspentTx.OutputStates.ToByteArray());
     writer.WriteInt32(unspentTx.OutputStates.Length);
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:10,代码来源:DataEncoder.cs

示例6: EncodePrevTxOutput

 public static void EncodePrevTxOutput(BinaryWriter writer, PrevTxOutput txOutput)
 {
     writer.WriteUInt64(txOutput.Value);
     writer.WriteVarBytes(txOutput.ScriptPublicKey.ToArray());
     writer.WriteInt32(txOutput.BlockHeight);
     writer.WriteInt32(txOutput.TxIndex);
     writer.WriteUInt32(txOutput.TxVersion);
     writer.WriteBool(txOutput.IsCoinbase);
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:9,代码来源:DataEncoder.cs

示例7: EncodeChainedHeader

 public static void EncodeChainedHeader(BinaryWriter writer, ChainedHeader chainedHeader)
 {
     writer.WriteUInt256(chainedHeader.Hash);
     EncodeBlockHeader(writer, chainedHeader.BlockHeader);
     writer.WriteInt32(chainedHeader.Height);
     writer.WriteVarBytes(chainedHeader.TotalWork.ToByteArray());
     writer.WriteInt64(chainedHeader.DateSeen.UtcTicks);
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:8,代码来源:DataEncoder.cs

示例8: WritePart3

        public void WritePart3(BinaryWriter writer)
        {
            this.Part3BaseAddress = (uint)writer.BaseStream.Position;
            Debug.Assert(this.Part3BaseAddress == 0xf30 + this.Index * 0x10);

            writer.WriteInt32((int)this.TargetState);
            writer.WriteInt32(this.UnkFlag);
            writer.WriteInt32(this.Commands.Count);
            writer.WriteInt32(0); // script address placeholder
        }
开发者ID:dantarion,项目名称:ssf4ae-tools,代码行数:10,代码来源:ClgLevel.cs

示例9: WritePart2

        public void WritePart2(BinaryWriter writer)
        {
            writer.WriteZeroBytes(4);
            writer.WriteInt32(this.Unk_BLR1);
            writer.WriteInt32(this.ResUnk2);
            writer.WriteInt32(-1);

            writer.WriteInt32(0x1a);
            writer.WriteInt32(1);
            writer.WriteInt32(this.Unk_Confusing);
            writer.WriteZeroBytes(4);

            writer.WriteZeroBytes(16);
        }
开发者ID:dantarion,项目名称:ssf4ae-tools,代码行数:14,代码来源:ClgLevel.cs

示例10: WritePart1

        public void WritePart1(BinaryWriter writer)
        {
            writer.WriteCharArrayString(this.Name, 8);
            writer.WriteZeroBytes(36);
            writer.Write(this.ResUnk1_1);
            writer.Write(this.ResUnk1_2);

            writer.WriteInt32(-1);
            writer.WriteZeroBytes(12);

            writer.Write(this.Unk_SGT5);
            writer.WriteZeroBytes(12);

            writer.WriteInt32(-2);
            writer.WriteInt32((int)this.UltraSelection);
            writer.WriteInt32(1);
            writer.WriteInt32(0x0ac0 - this.Index * 0x40);

            writer.WriteZeroBytes(8);
            writer.WriteInt32(1);
            writer.WriteInt32(0x0f60 - this.Index * 0x60);
        }
开发者ID:dantarion,项目名称:ssf4ae-tools,代码行数:22,代码来源:ClgLevel.cs

示例11: EncodeEvent

		public static void EncodeEvent(BinaryWriter writer, BuildEventArgs e)
		{
			EventTypes type = GetEventType(e);
			writer.WriteInt32((int)type);
			writer.WriteNullableString(e.Message);
			writer.WriteNullableString(e.HelpKeyword);
			writer.WriteNullableString(e.SenderName);
			writer.WriteDateTime(e.Timestamp);
			switch (type) {
				case EventTypes.Error:
					BuildErrorEventArgs error = (BuildErrorEventArgs)e;
					writer.WriteNullableString(error.Subcategory);
					writer.WriteNullableString(error.Code);
					writer.WriteNullableString(error.File);
					writer.WriteInt32(error.LineNumber);
					writer.WriteInt32(error.ColumnNumber);
					writer.WriteInt32(error.EndLineNumber);
					writer.WriteInt32(error.EndColumnNumber);
					break;
				case EventTypes.Warning:
					BuildWarningEventArgs warning = (BuildWarningEventArgs)e;
					writer.WriteNullableString(warning.Subcategory);
					writer.WriteNullableString(warning.Code);
					writer.WriteNullableString(warning.File);
					writer.WriteInt32(warning.LineNumber);
					writer.WriteInt32(warning.ColumnNumber);
					writer.WriteInt32(warning.EndLineNumber);
					writer.WriteInt32(warning.EndColumnNumber);
					break;
				case EventTypes.Message:
					BuildMessageEventArgs message = (BuildMessageEventArgs)e;
					writer.WriteInt32((int)message.Importance);
					break;
				case EventTypes.BuildFinished:
					BuildFinishedEventArgs buildFinished = (BuildFinishedEventArgs)e;
					writer.Write(buildFinished.Succeeded);
					break;
				case EventTypes.BuildStarted:
					break;
				case EventTypes.ProjectFinished:
					ProjectFinishedEventArgs projectFinished = (ProjectFinishedEventArgs)e;
					writer.WriteNullableString(projectFinished.ProjectFile);
					writer.Write(projectFinished.Succeeded);
					break;
				case EventTypes.ProjectStarted:
					ProjectStartedEventArgs projectStarted = (ProjectStartedEventArgs)e;
					writer.WriteNullableString(projectStarted.ProjectFile);
					writer.WriteNullableString(projectStarted.TargetNames);
					break;
				case EventTypes.TargetFinished:
					TargetFinishedEventArgs targetFinished = (TargetFinishedEventArgs)e;
					writer.WriteNullableString(targetFinished.TargetName);
					writer.WriteNullableString(targetFinished.ProjectFile);
					writer.WriteNullableString(targetFinished.TargetFile);
					writer.Write(targetFinished.Succeeded);
					break;
				case EventTypes.TargetStarted:
					TargetStartedEventArgs targetStarted = (TargetStartedEventArgs)e;
					writer.WriteNullableString(targetStarted.TargetName);
					writer.WriteNullableString(targetStarted.ProjectFile);
					writer.WriteNullableString(targetStarted.TargetFile);
					#if MSBUILD35
					writer.WriteNullableString(null);
					#else
					writer.WriteNullableString(targetStarted.ParentTarget);
					#endif
					break;
				case EventTypes.TaskFinished:
					TaskFinishedEventArgs taskFinished = (TaskFinishedEventArgs)e;
					writer.WriteNullableString(taskFinished.ProjectFile);
					writer.WriteNullableString(taskFinished.TaskFile);
					writer.WriteNullableString(taskFinished.TaskName);
					writer.Write(taskFinished.Succeeded);
					break;
				case EventTypes.TaskStarted:
					TaskStartedEventArgs taskStarted = (TaskStartedEventArgs)e;
					writer.WriteNullableString(taskStarted.ProjectFile);
					writer.WriteNullableString(taskStarted.TaskFile);
					writer.WriteNullableString(taskStarted.TaskName);
					break;
				default: // unknown etc.
					break;
			}
			
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:85,代码来源:EventSource.cs

示例12: WriteScript

        public void WriteScript(BinaryWriter writer)
        {
            this.BaseAddress = (uint)writer.BaseStream.Position;

            writer.WriteCharArrayString(this.OnScreenPart1, 32);
            writer.WriteCharArrayString(this.OnScreenPart2, 32);
            writer.WriteCharArrayString(this.OnScreenPart3, 32);
            writer.WriteCharArrayString(this.OnScreenPart4, 32);
            writer.WriteCharArrayString(this.HelpMenuPart1, 32);
            writer.WriteCharArrayString(this.HelpMenuPart2, 32);
            writer.WriteCharArrayString(this.HelpMenuPart3, 32);
            writer.WriteCharArrayString(this.HelpMenuPart4, 32);

            writer.Write((short)this.CriteriaType);
            writer.Write((ushort)this.CriteriaIds.Count);

            // Criteria offset placeholder
            writer.WriteInt32(0);
        }
开发者ID:dantarion,项目名称:ssf4ae-tools,代码行数:19,代码来源:ClgCommand.cs

示例13: WriteCriteria

        public void WriteCriteria(BinaryWriter writer)
        {
            var criteriaStart = writer.BaseStream.Position;
            var criteriaOffset = criteriaStart - this.BaseAddress;
            writer.Seek((int)(this.BaseAddress + 0x104), SeekOrigin.Begin);
            writer.Write((uint)criteriaOffset);
            writer.Seek((int)criteriaStart, SeekOrigin.Begin);

            for (int i = 0; i < this.CriteriaIds.Count; i++)
            {
                writer.WriteInt32(this.CriteriaIds[i]);
            }
        }
开发者ID:dantarion,项目名称:ssf4ae-tools,代码行数:13,代码来源:ClgCommand.cs

示例14: EncodeBlockTx

        public static void EncodeBlockTx(BinaryWriter writer, BlockTx blockTx)
        {
            var txBytes = blockTx.Transaction != null ? EncodeTransaction(blockTx.Transaction) : new byte[0];

            writer.WriteInt32(blockTx.Index);
            writer.WriteInt32(blockTx.Depth);
            writer.WriteUInt256(blockTx.Hash);
            writer.WriteBool(blockTx.Pruned);
            if (!blockTx.Pruned)
                EncodeTransaction(writer, blockTx.Transaction);
        }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:11,代码来源:DataEncoder.cs


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