示例#1
0
 /// <summary>
 /// Removes an item from the <see cref="E:TextHandlerMenu"/>
 /// </summary>
 /// <param name="item">The <see cref="ObjectText"/>'s component to be removed</param>
 private static void RemoveItem(ObjectTextEntry item)
 {
     menu?.Remove(menu.Components.Values.OfType <MenuBool>().Single(component => component.Name == $"st_core_drawings_text_{item.Id}"));
 }
示例#2
0
 /// <summary>
 /// Adds an item to the <see cref="E:TextHandlerMenu"/>
 /// </summary>
 /// <param name="item">The <see cref="ObjectText"/>'s component to be added</param>
 private static void AddItem(ObjectTextEntry item)
 {
     menu?.Add(new MenuBool($"st_core_drawings_text_{item.Id}", $"Enable \"{item.MenuText}\"", item.OnByDefault));
 }