公共的工具基类,负责通过 Reflection 提供类型的载入和存储功能,如 以下内容为程序代码: public class BinaryBlock { private static readonly ILog _log = LogManager.GetLogger(typeof(BinaryBlock)); public BinaryBlock() { } static public object LoadFromStream(BinaryReader reader, Type objType) { if(objType.Equals(typeof(char))) { return reader.ReadChar(); } else if(objType.Equals(typeof(byte))) { return reader.ReadByte(); } //... else if(objType.Equals(typeof(double))) { return reader.ReadDouble(); } else if(objType.IsArray) { // 处理数组的情况 } else { foreach(FieldInfo field in Cla
数据载入中...
页码:[1] [2] [3] [4] [5] [6] [7] [8] 第8页、共8页 |