public SmartObjectDynamicButtonIconListHelper(SmartObject smartObject, SmartObjectDynamicListHelperParameters helperParams)
     : base(smartObject, helperParams)
 {
     _items = new Dictionary <uint, SmartObjectDynamicButtonIconListItem>(MaxNumberOfItems);
     for (uint i = 1; i <= MaxNumberOfItems; i++)
     {
         _items.Add(i, new SmartObjectDynamicButtonIconListItem(this, i));
     }
     Items = new ReadOnlyDictionary <uint, SmartObjectDynamicButtonIconListItem>(_items);
 }
예제 #2
0
        public SmartObjectDynamicListHelper(SmartObject smartObject, SmartObjectDynamicListHelperParameters helperParams)
            : base(smartObject, helperParams)
        {
            MaxNumberOfItems = (ushort)_smartObject.BooleanOutput.Count(s => s.Name.EndsWith("Pressed"));

            _items = new Dictionary <uint, SmartObjectDynamicListItem>(MaxNumberOfItems);
            for (uint i = 1; i <= MaxNumberOfItems; i++)
            {
                _items.Add(i, new SmartObjectDynamicListItem(this, i));
            }
            Items = new ReadOnlyDictionary <uint, SmartObjectDynamicListItem>(_items);

            NumberOfItems = helperParams.NumberOfItems;
            if (helperParams.NumberOfItems > MaxNumberOfItems)
            {
                throw new ArgumentOutOfRangeException("helperParams.NumberOfItems", "Only " + MaxNumberOfItems + " items defined in the SGD file");
            }
            else
            {
                NumberOfItems = helperParams.NumberOfItems;
            }
        }
 public SmartObjectDynamicButtonIconListHelper(SmartObject smartObject, SmartObjectDynamicListHelperParameters helperParams)
     : base(smartObject, helperParams)
 {
 }
예제 #4
0
 public SmartObjectDynamicListHelper(SmartObject smartObject, SmartObjectDynamicListHelperParameters helperParams)
     : base(smartObject, helperParams)
 {
     NumberOfItems = helperParams.NumberOfItems;
 }