Ejemplo n.º 1
0
        public void Indexer()
        {
            ASClass @class = new ASClass("class", ASClassLayout.Dynamic, new string[] { "member" });
            ASObject obj = new ASObject(@class);

            obj["member"] = new ASInt29(1);
            Assert.AreEqual(new ASInt29(1), obj["member"]);
            Assert.AreEqual(new ASInt29(1), obj.MemberValues[0]);

            obj["nonmember"] = new ASInt29(2);
            Assert.AreEqual(new ASInt29(2), obj["nonmember"]);
            Assert.AreEqual(new ASInt29(2), obj.DynamicProperties["nonmember"]);
        }
Ejemplo n.º 2
0
        public void MixedValueIndexer()
        {
            ASArray array = new ASArray(0);

            array["abc"] = new ASInt29(1);
            Assert.AreEqual(new ASInt29(1), array["abc"]);

            // do it twice to be sure
            array["abc"] = new ASInt29(2);
            Assert.AreEqual(new ASInt29(2), array["abc"]);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override bool Equals(object obj)
        {
            ASInt29 other = obj as ASInt29;

            return(other != null && value == other.value);
        }