public static void AddControl <TBase, TBlock>(MyTerminalControl <TBase> control)
     where TBlock : TBase
     where TBase : MyTerminalBlock
 {
     GetList <TBlock>().Controls.Add(control);
     AddActions(control);
 }
 public MyTerminalAction(string id, StringBuilder name, Action <TBlock, ListReader <TerminalActionParameter> > action, MyTerminalControl <TBlock> .WriterDelegate valueWriter, string icon)
 {
     m_id   = id;
     m_name = name;
     ActionWithParameters = action;
     m_icon = icon;
     Writer = valueWriter;
 }
 public MyTerminalAction(string id, StringBuilder name, Action <TBlock> action, MyTerminalControl <TBlock> .WriterDelegate valueWriter, string icon)
 {
     m_id   = id;
     m_name = name;
     Action = action;
     m_icon = icon;
     Writer = valueWriter;
 }
 static void AddActions <TBlock>(int index, MyTerminalControl <TBlock> block)
     where TBlock : MyTerminalBlock
 {
     if (block.Actions != null)
     {
         foreach (var a in block.Actions)
         {
             AddAction <TBlock>(index++, (MyTerminalAction <TBlock>)a);
         }
     }
 }
 public MyTerminalAction(string id, StringBuilder name, Action <TBlock> action, MyTerminalControl <TBlock> .WriterDelegate valueWriter, string icon, Func <TBlock, bool> enabled = null)
     : this(id, name, action, valueWriter, icon)
 {
     if (enabled != null)
     {
         Enabled = enabled;
     }
 }
 public static void AddControl <TBlock>(int index, MyTerminalControl <TBlock> control)
     where TBlock : MyTerminalBlock
 {
     GetList <TBlock>().Controls.Insert(index, control);
     AddActions(index, control);
 }
 public static MyTerminalAction <TBlock> EnableAction <TBlock>(this MyTerminalControlButton <TBlock> button, string icon = null, MyStringId?title = null, MyTerminalControl <TBlock> .WriterDelegate writer = null)
     where TBlock : MyTerminalBlock
 {
     return(button.EnableAction(icon ?? MyTerminalActionIcons.TOGGLE, MyTexts.Get(title ?? button.Title), writer));
 }