本文整理汇总了C#中ByteReader.Read方法的典型用法代码示例。如果您正苦于以下问题:C# ByteReader.Read方法的具体用法?C# ByteReader.Read怎么用?C# ByteReader.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteReader
的用法示例。
在下文中一共展示了ByteReader.Read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddConstantsToTDB
// Add some non-zero constants to the mix.
public void AddConstantsToTDB(RandoopConfiguration config)
{
foreach (SimpleTypeValues vs in config.simpleTypeValues)
{
Type type = Type.GetType(vs.simpleType);
if (type == null)
{
throw new Common.RandoopBareExceptions.InternalError("invalid simple type in XML config file.");
}
foreach (FileName fn in vs.fileNames)
{
string fileName = fn.fileName;
if (!File.Exists(fileName))
{
throw new Common.RandoopBareExceptions.InvalidUserParamsException("Configuration file does not exist: " + fileName);
}
if (type.Equals(typeof(sbyte)))
{
SByteReader r = new SByteReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(sbyte), o));
}
else if (type.Equals(typeof(byte)))
{
ByteReader r = new ByteReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(byte), o));
}
else if (type.Equals(typeof(short)))
{
ShortReader r = new ShortReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(short), o));
}
else if (type.Equals(typeof(ushort)))
{
UshortReader r = new UshortReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(ushort), o));
}
else if (type.Equals(typeof(int)))
{
IntReader r = new IntReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(int), o));
}
else if (type.Equals(typeof(uint)))
{
UintReader r = new UintReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(uint), o));
}
else if (type.Equals(typeof(long)))
{
LongReader r = new LongReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(long), o));
}
else if (type.Equals(typeof(ulong)))
{
UlongReader r = new UlongReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(ulong), o));
}
else if (type.Equals(typeof(char)))
{
CharReader r = new CharReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(char), o));
}
else if (type.Equals(typeof(float)))
{
FloatReader r = new FloatReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(float), o));
}
else if (type.Equals(typeof(double)))
{
DoubleReader r = new DoubleReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(double), o));
}
else if (type.Equals(typeof(bool)))
{
BoolReader r = new BoolReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(bool), o));
}
else if (type.Equals(typeof(decimal)))
{
DecimalReader r = new DecimalReader();
foreach (object o in r.Read(fileName))
this.AddPlan(Plan.Constant(typeof(decimal), o));
}
else
{
//.........这里部分代码省略.........