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


C# StreamWriter.WriteSingle方法代码示例

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


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

示例1: Serialize

 public void Serialize(
     StreamWriter streamWriter, 
     SerializationContext serializationContext, 
     object value, 
     PropertyMetaData propertyMetaData = null)
 {
     streamWriter.WriteSingle((short)value);
 }
开发者ID:gordonc64,项目名称:AOtomation.Messaging,代码行数:8,代码来源:SingleSerializer.cs

示例2: Serialize

        public void Serialize(
            StreamWriter streamWriter,
            SerializationContext serializationContext,
            object value,
            PropertyMetaData propertyMetaData = null)
        {            if (value == null)
            {
                return;
            }

            var ftinfo = value as FollowTargetInfo;
            if (ftinfo != null)
            {
                streamWriter.WriteByte(ftinfo.FollowInfoType);
                streamWriter.WriteByte(ftinfo.MoveType);
                streamWriter.WriteInt32((int)ftinfo.Target.Type);
                streamWriter.WriteInt32(ftinfo.Target.Instance);
                streamWriter.WriteByte(ftinfo.Dummy);
                streamWriter.WriteInt32(ftinfo.Dummy1);
                streamWriter.WriteSingle(ftinfo.X);
                streamWriter.WriteSingle(ftinfo.Y);
                streamWriter.WriteSingle(ftinfo.Z);
            }
            var fcinfo = value as FollowCoordinateInfo;
            if (fcinfo != null)
            {
                streamWriter.WriteByte(fcinfo.FollowInfoType);
                streamWriter.WriteByte(fcinfo.MoveMode);
                streamWriter.WriteByte(fcinfo.CoordinateCount);
                streamWriter.WriteSingle(fcinfo.CurrentCoordinates.X);
                streamWriter.WriteSingle(fcinfo.CurrentCoordinates.Y);
                streamWriter.WriteSingle(fcinfo.CurrentCoordinates.Z);
                streamWriter.WriteSingle(fcinfo.EndCoordinates.X);
                streamWriter.WriteSingle(fcinfo.EndCoordinates.Y);
                streamWriter.WriteSingle(fcinfo.EndCoordinates.Z);
            }
        }
开发者ID:gordonc64,项目名称:AOtomation.Messaging,代码行数:37,代码来源:FollowInfoSerializer.cs


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