コード例 #1
0
 public static void AddControl <TBase, TBlock>(MyTerminalControl <TBase> control)
     where TBlock : TBase
     where TBase : MyTerminalBlock
 {
     GetList <TBlock>().Controls.Add(control);
     AddActions(control);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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);
         }
     }
 }
コード例 #5
0
 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;
     }
 }
コード例 #6
0
 public static void AddControl <TBlock>(int index, MyTerminalControl <TBlock> control)
     where TBlock : MyTerminalBlock
 {
     GetList <TBlock>().Controls.Insert(index, control);
     AddActions(index, control);
 }
コード例 #7
0
 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));
 }