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


C# BinaryWriter.WriteDateTime方法代码示例

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


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

示例1: Serialize

 ///<exclude/>
 public void Serialize(BinaryWriter bw)
 {
     bw.Write(seq);
     bw.WriteDateTime(stamp);
     bw.WriteUtf8String(frame_id);
 }
开发者ID:terakenxx,项目名称:TukubaChallenge,代码行数:7,代码来源:Header.cs

示例2: 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

示例3: Serialize

 ///<exclude/>
 public void Serialize(BinaryWriter bw)
 {
     bw.WriteDateTime(data);
 }
开发者ID:garaemon,项目名称:RosSharp,代码行数:5,代码来源:Time.cs

示例4: Serialize

 ///<exclude/>
 public void Serialize(BinaryWriter bw)
 {
     bw.WriteDateTime(clock);
 }
开发者ID:terakenxx,项目名称:TukubaChallenge,代码行数:5,代码来源:Clock.cs


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