Exemple #1
0
        internal TDotNetType Read <TDotNetType>()
        {
            Func <BufferReader, object> func;

            if (!DotNetTypeReadMethods.TryGetValue(typeof(TDotNetType), out func))
            {
                throw new InvalidOperationException($"{typeof(TDotNetType).Name} is not a valid type for Read<TDotNetType>. Valid choices: { string.Join(", ", DotNetTypeReadMethods.Keys.Select(x => x.Name)) }.");
            }

            return((TDotNetType)func(this));
        }
Exemple #2
0
 private static bool IsSteamCompatibleNumericalType(Type t)
 {
     return(DotNetTypeReadMethods.ContainsKey(t) && t != typeof(string));
 }