Exemple #1
0
        public void RemoveAction <TBlock>(IMyTerminalAction action)
        {
            if (!IsTypeValid <TBlock>())
            {
                return;
            }

            Type producedType = GetProducedType <TBlock>();

            if (producedType == null)
            {
                return;
            }

            var blockList = MyTerminalControlFactory.GetList(producedType).Actions;

            blockList.Remove((ITerminalAction)action);
        }
Exemple #2
0
        public void GetControls <TBlock>(out List <IMyTerminalControl> items)
        {
            items = new List <IMyTerminalControl>();
            if (!IsTypeValid <TBlock>())
            {
                return;
            }

            Type producedType = GetProducedType <TBlock>();

            if (producedType == null)
            {
                return;
            }

            var blockList = MyTerminalControlFactory.GetList(producedType);

            foreach (var item in blockList.Controls)
            {
                items.Add((IMyTerminalControl)item);
            }
        }