當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。