Exemple #1
0
 public void Read(NetworkReader reader)
 {
     Tag = (JsValueType)reader.ReadByte();
     switch (Tag) {
         case JsValueType.Null:
         case JsValueType.Void:
             Object = null;
             break;
         case JsValueType.Bool:
             Object = reader.ReadBoolean();
             break;
         case JsValueType.Int:
             Object = reader.ReadInt32();
             break;
         case JsValueType.Double:
             Object = reader.ReadDouble();
             break;
         case JsValueType.String:
             Object = reader.ReadString();
             break;
         case JsValueType.Object:
         case JsValueType.JsObject:
         case JsValueType.Delegate:
             Object = reader.ReadInt32();
             break;
         default:
             throw new InvalidDataException();
     }
 }
Exemple #2
0
 public override void Read(NetworkReader reader)
 {
     Value = new JsValue();
     IsException = reader.ReadBoolean();
     Value.Read(reader);
 }