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


C# Formatter.close方法代码示例

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


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

示例1: displayData

		private void displayData(int mode, SmotionActivity.Info[] info)
		{
			// TODO Auto-generated method stub
			string str = getMode(mMode);
			StringBuilder sb = new StringBuilder();
			if (mIsPeriodicMode && (mode == SmotionActivity.Info.MODE_REALTIME))
			{
				sb.Append("Periodic Mode : " + mInterval / 1000 + " sec" + "\n");
			}

			sb.Append("<" + getMode(mode) + ">");
			if (MotionTest.mIsUpdateInfo)
			{
				if (mMode == SmotionActivity.Info.MODE_ALL)
				{
					if (UpdateInfoBatchModeSupport)
					{
						sb.Append(" - Update" + " All" + " Data");
					}
					else
					{
						sb.Append(" - Update " + getMode(mode) + " Data");
					}
				}
				else
				{
					sb.Append(" - Update " + getMode(mode) + " Data");
				}
				MotionTest.mIsUpdateInfo = false;
			}
			sb.Append("\n");
			for (int i = 0; i < info.Length; i++)
			{
				long timestamp = 0;
				if (mIsPeriodicMode)
				{
					if (mode == SmotionActivity.Info.MODE_REALTIME)
					{
						timestamp = DateTimeHelperClass.CurrentUnixTimeMillis();
					}
					else if (mode == SmotionActivity.Info.MODE_BATCH)
					{
						timestamp = info[i].TimeStamp;
					}
				}
				else
				{
					timestamp = info[i].TimeStamp;
				}

				Time time = new Time();
				time.set(timestamp);
				Formatter form = new Formatter();
				form.format("%02d:%02d:%02d", time.hour, time.minute, time.second);
				sb.Append("[" + form.ToString() + "] ");
				form.close();
				sb.Append(getStatus(info[i].Status));
				sb.Append("(" + getAccuracy(info[i].Accuracy) + ")");
				sb.Append("\n");
			}

			switch (mode)
			{
				case SmotionActivity.Info.MODE_REALTIME:
					mQueue[0] = sb.ToString();
					break;

				case SmotionActivity.Info.MODE_BATCH:
					mQueue[1] = sb.ToString();
					break;
				default:
					break;
			}

			sb = new StringBuilder();
			for (int i = 0; i < mQueue.Length; i++)
			{
				if (mQueue[i] != null)
				{
					sb.Append(mQueue[i] + "\n");
				}
			}
			if (str != null)
			{
				MotionTest.displayData(0, str, sb.ToString());
			}
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:87,代码来源:MotionActivity.cs

示例2: displayData

		private void displayData(SmotionActivityNotification.Info info)
		{
			StringBuilder sb = new StringBuilder();
			string str = null;
			long timestamp = info.TimeStamp;
			Time time = new Time();
			time.set(timestamp);
			Formatter form = new Formatter();
			form.format("%02d:%02d:%02d", time.hour, time.minute, time.second);
			sb.Append("[" + form.ToString() + "] ");
			form.close();
			str = getStatus(info.Status);

			sb.Append("(" + getAccuracy(info.Accuracy) + ")");
			if (str != null)
			{
				MotionTest.displayData(0, str, sb.ToString());
			}
		}
开发者ID:moljac,项目名称:Samples.Data.Porting,代码行数:19,代码来源:MotionActivityNotification.cs


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