Exemplo n.º 1
0
 public object Get(ComplexClassForOpenRastaSerializationTests data)
 {
   ObjectSerializer serializer = new ObjectSerializer(data.GetType());
   ObjectToStringPropertyVisitor visitor = new ObjectToStringPropertyVisitor();
   serializer.Serialize(data, visitor);
   return visitor.Result;
 }
Exemplo n.º 2
0
    public static Dictionary<string, string> ConvertObjectPropertiesToDictionary(object src)
    {
      Dictionary<string, string> result = new Dictionary<string, string>();

      if (src == null)
        return result;

      Type t = src.GetType();
      ObjectSerializer Serializer = new ObjectSerializer(t);

      DictionaryConverterPropertyVisitor visitor = new DictionaryConverterPropertyVisitor();
      Serializer.Serialize(src, visitor);

      return visitor.Result;
    }
Exemplo n.º 3
0
    public static Hashtable ConvertObjectPropertiesToHashtable(object src)
    {
      Hashtable result = new Hashtable();

      if (src == null)
        return result;

      Type t = src.GetType();
      ObjectSerializer Serializer = new ObjectSerializer(t);

      HashtableConverterPropertyVisitor visitor = new HashtableConverterPropertyVisitor();
      Serializer.Serialize(src, visitor);

      return visitor.Result;
    }
Exemplo n.º 4
0
 public FormUrlEncodingSerializer(Type t)
 {
     Serializer = new ObjectSerializer(t);
 }
Exemplo n.º 5
0
 public MultipartFormDataSerializer(Type t)
 {
   Serializer = new ObjectSerializer(t);
 }