bc.flash.AsObject.setOwnProperty C# (CSharp) Method

setOwnProperty() public method

public setOwnProperty ( String name, Object _value ) : void
name String
_value Object
return void
        public virtual void setOwnProperty(String name, Object _value)
        {
            if (mProperties == null)
            {
                mProperties = new Dictionary<String, Object>();
            }
            if (mProperties.ContainsKey(name))
            {
                mProperties.Remove(name);
            }
            mProperties[name] = _value;
        }

Usage Example

        public static Object createLiteralObject(params Object[] values)
        {
            if (values.Length % 2 != 0)
            {
                throw new ArgumentException("Literal object arguments' length should be even: " + values);
            }

            AsObject obj = new AsObject();
            for (int i = 0; i < values.Length; i += 2)
            {
                String key = (String) values[i];
                Object value = values[i + 1];
                obj.setOwnProperty(key, value);
            }
            return obj;
        }
All Usage Examples Of bc.flash.AsObject::setOwnProperty