Example #1
0
        public void SetupRegistry()
        {
            ABSRegistry.LoadedSegments.Clear();

            var newSegment = new RegSegment();

            StringItem = new RegString()
            {
                Data = "InRegistry"
            };
            IntegerItem = new RegInteger()
            {
                Data = 12
            };
            DecimalItem = new RegDecimal()
            {
                Data = 12.3f
            };
            BooleanGroupItem = new RegBooleanGroup();

            BooleanGroupItem.SetItem(5, true);
            BooleanGroupItem.SetItem(6, false);

            ABSRegistry.LoadedSegments.Add("abc", newSegment);
            newSegment.AddItem("stringItm", StringItem);
            newSegment.AddItem("integerItm", IntegerItem);
            newSegment.AddItem("decimalItm", DecimalItem);
            newSegment.AddItem("booleanGroupItm", BooleanGroupItem);
        }
Example #2
0
        public void RegBooleanGroup()
        {
            var  item     = new RegBooleanGroup();
            bool eventRan = false;

            item.BooleanItemChanged += (s, e) =>
            {
                Assert.AreEqual(7, e.Pos);
                eventRan = true;
            };

            item.SetItem(7, true);
            Assert.IsTrue(eventRan);

            Assert.IsTrue(item.GetItem(7));

            item.SetItem(7, false);
            Assert.IsFalse(item.GetItem(7));
        }