/// <summary> /// Creates a factory with the specified mapping table. /// </summary> /// <param name="mappingTable">The mapping table</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="mappingTable"/> is null</exception> public MappedActionScriptSerializerFactory(ActionScriptMappingTable mappingTable) { if (mappingTable == null) { throw new ArgumentNullException("mappingTable"); } this.mappingTable = mappingTable; }
/// <summary> /// Creates a factory with a new mapping table. /// </summary> /// <param name="registerBuiltInMapperFactories">If true, calls <see cref="ActionScriptMappingTable.RegisterBuiltInMapperFactories" /> /// to register all built-in mappers automatically</param> public MappedActionScriptSerializerFactory(bool registerBuiltInMapperFactories) { mappingTable = new ActionScriptMappingTable(); if (registerBuiltInMapperFactories) { mappingTable.RegisterBuiltInMapperFactories(); } }
public override void SetUp() { base.SetUp(); ActionScriptMappingTable mappingTable = new ActionScriptMappingTable(); mappingTable.RegisterBuiltInMapperFactories(); serializer = new MappedActionScriptSerializer(mappingTable); }
/// <summary> /// Creates a new serializer. /// </summary> /// <param name="mappingTable">The mapping table</param> /// <exception cref="ArgumentNullException">Thrown if the <paramref name="mappingTable"/> is null</exception> public MappedActionScriptSerializer(ActionScriptMappingTable mappingTable) { if (mappingTable == null) { throw new ArgumentNullException("mappingTable"); } this.mappingTable = mappingTable; this.nativeReferenceCache = new Dictionary <object, IASValue>(ReferenceEqualityComparer <object> .Instance); this.asReferenceCache = new Dictionary <ASReferenceCacheKey, object>(); }