Пример #1
0
        /// <summary>
        /// Creates a wrapper for a native array-like value.
        /// </summary>
        /// <param name="nativeArray">The native array-like object</param>
        /// <param name="mapper">The mapper to use for mapping the array to ActionScript on demand</param>
        /// <param name="isByteArray">Set to true if the array should be mapped as a byte array</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeArray"/>
        /// or <paramref name="mapper"/> is null</exception>
        public ASNativeArray(object nativeArray, IASNativeArrayMapper mapper, bool isByteArray)
        {
            if (nativeArray == null)
                throw new ArgumentNullException("nativeArray");
            if (mapper == null)
                throw new ArgumentNullException("mapper");

            this.nativeArray = nativeArray;
            this.mapper = mapper;
            this.isByteArray = isByteArray;
        }
Пример #2
0
        /// <summary>
        /// Creates a wrapper for a native array-like value.
        /// </summary>
        /// <param name="nativeArray">The native array-like object</param>
        /// <param name="mapper">The mapper to use for mapping the array to ActionScript on demand</param>
        /// <param name="isByteArray">Set to true if the array should be mapped as a byte array</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeArray"/>
        /// or <paramref name="mapper"/> is null</exception>
        public ASNativeArray(object nativeArray, IASNativeArrayMapper mapper, bool isByteArray)
        {
            if (nativeArray == null)
            {
                throw new ArgumentNullException("nativeArray");
            }
            if (mapper == null)
            {
                throw new ArgumentNullException("mapper");
            }

            this.nativeArray = nativeArray;
            this.mapper      = mapper;
            this.isByteArray = isByteArray;
        }
Пример #3
0
        /// <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="nativeArray">The native array-like object</param>
        /// <param name="mapper">The mapper to use for mapping the array to ActionScript on demand</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeArray"/> or <paramref name="mapper"/> is null</exception>
        /// <exception cref="InvalidOperationException">Thrown if the object has already been initialized</exception>
        public void SetProperties(object nativeArray, IASNativeArrayMapper mapper)
        {
            if (IsInitialized)
            {
                throw new InvalidOperationException("The object's properties may not be set once initialized.");
            }

            if (nativeArray == null)
            {
                throw new ArgumentNullException("nativeArray");
            }
            if (mapper == null)
            {
                throw new ArgumentNullException("mapper");
            }

            this.nativeArray = nativeArray;
            this.mapper      = mapper;
        }
Пример #4
0
        /// <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="nativeArray">The native array-like object</param>
        /// <param name="mapper">The mapper to use for mapping the array to ActionScript on demand</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="nativeArray"/> or <paramref name="mapper"/> is null</exception>
        /// <exception cref="InvalidOperationException">Thrown if the object has already been initialized</exception>
        public void SetProperties(object nativeArray, IASNativeArrayMapper mapper)
        {
            if (IsInitialized)
                throw new InvalidOperationException("The object's properties may not be set once initialized.");

            if (nativeArray == null)
                throw new ArgumentNullException("nativeArray");
            if (mapper == null)
                throw new ArgumentNullException("mapper");

            this.nativeArray = nativeArray;
            this.mapper = mapper;
        }