本文整理汇总了C#中AMFWriter.WriteBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# AMFWriter.WriteBoolean方法的具体用法?C# AMFWriter.WriteBoolean怎么用?C# AMFWriter.WriteBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMFWriter
的用法示例。
在下文中一共展示了AMFWriter.WriteBoolean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteData
public void WriteData(AMFWriter writer, object data) {
if (data is INullable) {
if ((data as INullable).IsNull) {
writer.WriteNull();
return;
}
}
if (data is SqlByte) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlByte)data).Value);
return;
}
if (data is SqlInt16) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlInt16)data).Value);
return;
}
if (data is SqlInt32) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlInt32)data).Value);
return;
}
if (data is SqlInt64) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlInt64)data).Value);
return;
}
if (data is SqlSingle) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlSingle)data).Value);
return;
}
if (data is SqlDouble) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlDouble)data).Value);
return;
}
if (data is SqlDecimal) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlDecimal)data).Value);
return;
}
if (data is SqlMoney) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlMoney)data).Value);
return;
}
if (data is SqlDateTime) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlDateTime)data).Value);
return;
}
if (data is SqlString) {
writer.WriteString(((SqlString)data).Value);
return;
}
if (data is SqlGuid) {
writer.WriteData(ObjectEncoding.AMF0, ((SqlGuid)data).Value.ToString("D"));
return;
}
if (data is SqlBoolean) {
writer.WriteBoolean(((SqlBoolean)data).Value);
return;
}
string msg = string.Format("Could not find serializer for type {0}", data.GetType().FullName);
if (_log.IsErrorEnabled)
_log.Error(msg);
throw new FluorineException(msg);
}
示例2: WriteData
public void WriteData(AMFWriter writer, object data) {
writer.WriteByte(AMF0TypeCode.Boolean);
writer.WriteBoolean((bool)data);
}