/// <summary>
 /// Copying constructor.
 /// </summary>
 /// <param name="cfg">Configuration to copy.</param>
 public PortableTypeConfiguration(PortableTypeConfiguration cfg)
 {
     AffinityKeyFieldName = cfg.AffinityKeyFieldName;
     AssemblyName = cfg.AssemblyName;
     IdMapper = cfg.IdMapper;
     NameMapper = cfg.NameMapper;
     Serializer = cfg.Serializer;
     TypeName = cfg.TypeName;
     MetadataEnabled = cfg.MetadataEnabled;
     KeepDeserialized = cfg.KeepDeserialized;
 }
 /// <summary>
 /// Copying constructor.
 /// </summary>
 /// <param name="cfg">Configuration to copy.</param>
 public PortableTypeConfiguration(PortableTypeConfiguration cfg)
 {
     AffinityKeyFieldName = cfg.AffinityKeyFieldName;
     AssemblyName         = cfg.AssemblyName;
     IdMapper             = cfg.IdMapper;
     NameMapper           = cfg.NameMapper;
     Serializer           = cfg.Serializer;
     TypeName             = cfg.TypeName;
     MetadataEnabled      = cfg.MetadataEnabled;
     KeepDeserialized     = cfg.KeepDeserialized;
 }
        public void TestPrimitiveFieldsRawSerializer()
        {
            ICollection<PortableTypeConfiguration> typeCfgs = 
                new List<PortableTypeConfiguration>();

            PortableTypeConfiguration typeCfg =
                new PortableTypeConfiguration(typeof(PrimitiveFieldType));

            typeCfg.Serializer = new PrimitiveFieldsRawSerializer();

            typeCfgs.Add(typeCfg);

            PortableConfiguration cfg = new PortableConfiguration();

            cfg.TypeConfigurations = typeCfgs;

            PortableMarshaller marsh = new PortableMarshaller(cfg);

            PrimitiveFieldType obj = new PrimitiveFieldType();

            CheckPrimitiveFields(marsh, obj);
        }
        public void TestKeepSerializedTypeCfgTrue()
        {
            PortableTypeConfiguration typeCfg = new PortableTypeConfiguration(typeof(PropertyType));
            typeCfg.KeepDeserialized = true;

            PortableConfiguration cfg = new PortableConfiguration();
            cfg.DefaultKeepDeserialized = false;

            cfg.TypeConfigurations = new List<PortableTypeConfiguration> { typeCfg };

            CheckKeepSerialized(cfg, true);
        }