本文整理汇总了C#中ProtoBuf.ProtoReader.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoReader.ReadBoolean方法的具体用法?C# ProtoReader.ReadBoolean怎么用?C# ProtoReader.ReadBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoBuf.ProtoReader
的用法示例。
在下文中一共展示了ProtoReader.ReadBoolean方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadField
object ReadField(ProtoReader reader, Type memberT, string sClassName, CLS_Environment environment)
{
if (memberT == typeof(int))
{
return reader.ReadInt32();
}
else if (memberT == typeof(uint))
{
return reader.ReadUInt32();
}
else if (memberT == typeof(bool))
{
return reader.ReadBoolean();
}
else if (memberT == typeof(byte))
{
return reader.ReadByte();
}
else if (memberT == typeof(sbyte))
{
return reader.ReadSByte();
}
else if (memberT == typeof(float))
{
return reader.ReadSingle();
}
else if (memberT == typeof(double))
{
return reader.ReadDouble();
}
else if (memberT == typeof(short))
{
return reader.ReadInt16();
}
else if (memberT == typeof(ushort))
{
return reader.ReadUInt16();
}
else if (memberT == typeof(long))
{
return reader.ReadInt64();
}
else if (memberT == typeof(ulong))
{
return reader.ReadUInt64();
}
else if (memberT == typeof(string))
{
return reader.ReadString();
}
else if (memberT == typeof(byte[]))
{
return ProtoReader.AppendBytes(null, reader);
}
else if (memberT == typeof(SInstance))
{
SubItemToken st = ProtoReader.StartSubItem(reader);
CLS_Type_Class sClass = environment.GetTypeByKeywordQuiet(sClassName) as CLS_Type_Class;
if (!sClass.compiled)
RuntimeCompilerClass(sClassName);
CLS_Content content = CLS_Content.NewContent(environment);
CLS_Content.Value retVal = sClass.function.New(content, m_emptyParams);
CLS_Content.PoolContent(content);
SInstance sInstance = (SInstance)retVal.value;
ReadSInstance(reader, sInstance, environment);
ProtoReader.EndSubItem(st, reader);
return sInstance;
}
else
{
throw new NotImplementedException("未实现类型: " + memberT);
}
}