/// <summary> /// Creates a wrapper for a native value. /// </summary> /// <param name="class">The ActionScript class</param> /// <param name="nativeObject">The native object</param> /// <param name="mapper">The mapper to use for mapping the object to ActionScript on demand</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="class"/>, <paramref name="nativeObject"/>, /// or <paramref name="mapper"/> is null</exception> public ASNativeObject(ASClass @class, object nativeObject, IASNativeObjectMapper mapper) { if (@class == null) throw new ArgumentNullException("class"); if (nativeObject == null) throw new ArgumentNullException("nativeObject"); if (mapper == null) throw new ArgumentNullException("mapper"); this.@class = @class; this.nativeObject = nativeObject; this.mapper = mapper; }
/// <summary> /// Creates a wrapper for a native value. /// </summary> /// <param name="class">The ActionScript class</param> /// <param name="nativeObject">The native object</param> /// <param name="mapper">The mapper to use for mapping the object to ActionScript on demand</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="class"/>, <paramref name="nativeObject"/>, /// or <paramref name="mapper"/> is null</exception> public ASNativeObject(ASClass @class, object nativeObject, IASNativeObjectMapper mapper) { if (@class == null) { throw new ArgumentNullException("class"); } if (nativeObject == null) { throw new ArgumentNullException("nativeObject"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } this.@class = @class; this.nativeObject = nativeObject; this.mapper = mapper; }
/// <summary> /// Sets the properties of an instance created by <see cref="CreateUninitializedInstance" />. /// </summary> /// <remarks> /// This special case is used to resolve circular references during the construction of /// object graphs. The object should not be used until its properties have been initialized. /// </remarks> /// <param name="nativeObject">The native object</param> /// <param name="mapper">The mapper to use for mapping the object to ActionScript on demand</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeObject"/> or <paramref name="mapper"/> is null</exception> /// <exception cref="InvalidOperationException">Thrown if the object has already been initialized</exception> public void SetProperties(object nativeObject, IASNativeObjectMapper mapper) { if (IsInitialized) { throw new InvalidOperationException("The object's properties may not be set once initialized."); } if (nativeObject == null) { throw new ArgumentNullException("nativeObject"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } this.nativeObject = nativeObject; this.mapper = mapper; }
/// <summary> /// Sets the properties of an instance created by <see cref="CreateUninitializedInstance" />. /// </summary> /// <remarks> /// This special case is used to resolve circular references during the construction of /// object graphs. The object should not be used until its properties have been initialized. /// </remarks> /// <param name="nativeObject">The native object</param> /// <param name="mapper">The mapper to use for mapping the object to ActionScript on demand</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeObject"/> or <paramref name="mapper"/> is null</exception> /// <exception cref="InvalidOperationException">Thrown if the object has already been initialized</exception> public void SetProperties(object nativeObject, IASNativeObjectMapper mapper) { if (IsInitialized) throw new InvalidOperationException("The object's properties may not be set once initialized."); if (nativeObject == null) throw new ArgumentNullException("nativeObject"); if (mapper == null) throw new ArgumentNullException("mapper"); this.nativeObject = nativeObject; this.mapper = mapper; }