public static void AddItems(this Menu menu, List<MenuItem> menuItems) { foreach (var menuItem in menuItems) { menu.AddItem(menuItem); } }
public static MenuItem AddHitChance(this Menu menu, string name, string displayName, HitChance defaultHitChance) { return menu.AddItem( new MenuItem(name, displayName).SetValue( new StringList(new[] { "Low", "Medium", "High", "Very High" }, (int) defaultHitChance - 3))); }
public static void AddItem(this SenseListControl control, SenseListControl.ISenseListItem item, bool giveUniqueName) { if (giveUniqueName) { item.Name = "UniqueName" + _counter++; } control.AddItem(item); }
public static DsalBinarySearchTree AddItems(this DsalBinarySearchTree bst, IEnumerable<int> itemsToAdd) { foreach (var item in itemsToAdd) { bst.AddItem(item); } return bst; }
public static MenuItem AddList(this Menu menu, string name, string displayName, string[] list, int selectedIndex = 0) { return menu.AddItem(new MenuItem(name, displayName).SetValue(new StringList(list, selectedIndex))); }
public static LeagueSharp.Common.MenuItem KeyBind(this LeagueSharp.Common.Menu subMenu, string name, string display, Keys key, KeyBindType type = KeyBindType.Press) { return subMenu.AddItem(new LeagueSharp.Common.MenuItem(name, display).SetValue<KeyBind>(new KeyBind((uint)key, type))); }
public static OrderItem AddItem(this Order order, string product) { var orderItem = new OrderItem {Product = product}; order.AddItem(orderItem); return orderItem; }
public static GenericMenu Add(this GenericMenu menu, string text, Action func, bool selected = false) { if (func == null) { menu.AddDisabledItem(new GUIContent(text)); } else { menu.AddItem(new GUIContent(text), selected, () => func()); } return menu; }
public static void AddSlider(this Menu menu, string name, string displayName, int value, int min = 0, int max = 100) { menu.AddItem(new MenuItem(name, displayName).SetValue(new Slider(value, min, max))); }
public static void AddCircle(this Menu menu, string name, string displayName, Color color, float radius = 0, bool enabled = true) { menu.AddItem(new MenuItem(name, displayName).SetValue(new Circle(enabled, color, radius))); }
public static void AddObject(this Menu menu, string name, string displayName, object value = null) { var i = menu.AddItem(new MenuItem(name, displayName)); if (value != null) { i.SetValue(value); } }
public static void AddKeyBind(this Menu menu, string name, string displayName, uint key, KeyBindType type = KeyBindType.Press, bool defaultValue = false) { menu.AddItem(new MenuItem(name, displayName).SetValue(new KeyBind(key, type, defaultValue))); }
public static void AddItem( this GenericMenu menu, string osxText, string osxKey, string winText, string winKey, bool on, GenericMenu.MenuFunction func) { #if UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 if (Application.platform == RuntimePlatform.OSXEditor) menu.AddItem(new GUIContent(osxText + " _" + osxKey), on, func); else menu.AddItem(new GUIContent(winText + " _" + winKey), on, func); #else if (Application.platform == RuntimePlatform.OSXEditor) menu.AddItem(new GUIContent(osxText), on, func); else menu.AddItem(new GUIContent(winText + DecodeWinKey(winKey)), on, func); #endif }
//TODO make it better? public static void AddKillstealMenu(this Menu menu, SpellSlot[] spells, bool[] values) { for (int i = 0; i < spells.Count(); i++) { menu.AddItem( new MenuItem( "com.idzkatarina.killsteal.use" + GetStringFromSpellSlot(spells[i]).ToLowerInvariant(), "Use " + GetStringFromSpellSlot(spells[i]) + " Killsteal")); } }
public static void AddModeMenu(this LeagueSharp.Common.Menu menu, Mode mode, SpellSlot[] spellList, bool[] values) { for (var i = 0; i < spellList.Count(); i++) { menu.AddItem( new MenuItem( BaseName + ObjectManager.Player.ChampionName.ToLowerInvariant() + ".use" + GetStringFromSpellSlot(spellList[i]).ToLowerInvariant() + GetStringFromMode(mode), "Use " + GetStringFromSpellSlot(spellList[i]) + " " + GetFullNameFromMode(mode)).SetValue(values[i])); } }
public static void AddModeMenu(this Menu menu, Mode mode, SpellSlot[] spellList, bool[] values) { for (var i = 0; i < spellList.Count(); i++) { menu.AddItem( new MenuItem( "dzaio.champion."+DZAIO.Player.ChampionName.ToLowerInvariant()+".use" + GetStringFromSpellSlot(spellList[i]).ToLowerInvariant() + GetStringFromMode(mode), "Use " + GetStringFromSpellSlot(spellList[i]) + " " + GetFullNameFromMode(mode)).SetValue(values[i])); } }
public static void AddOptionalItem(this GenericMenu menu, bool isEnabled, GUIContent content, bool isOn, GenericMenu.MenuFunction handler) { if (isEnabled) { menu.AddItem(content, isOn, handler); } else { menu.AddDisabledItem(content); } }
public static void AddDrawMenu(this Menu menu, Dictionary<SpellSlot,Spell> dictionary,Color myColor) { foreach (var entry in dictionary) { var slot = entry.Key; if (entry.Value.Range < 4000f) { menu.AddItem(new MenuItem("dzaio."+ObjectManager.Player.ChampionName.ToLowerInvariant() + ".drawing.draw" + GetStringFromSpellSlot(slot), "Draw " + GetStringFromSpellSlot(slot)).SetValue(new Circle(true, myColor))); } } }
public static void AddBool(this Menu menu, string path, string message, bool toggle = true) { try { menu.AddItem(new MenuItem("apollo.leblanc." + path, message).SetValue(toggle)); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public static void AddDrawMenu(this LeagueSharp.Common.Menu menu, Dictionary<SpellSlot, Spell> dictionary, Color myColor) { foreach (var entry in dictionary) { var slot = entry.Key; if (entry.Value.Range < 4000f) { menu.AddItem(new MenuItem(BaseName + ".drawing.draw" + GetStringFromSpellSlot(slot), "Draw " + GetStringFromSpellSlot(slot)).SetValue(new Circle(true, myColor))); } } }
public static void AddDrawMenu(this Menu menu, Dictionary<SpellSlot, Spell> dictionary, System.Drawing.Color myColor) { foreach (var entry in dictionary) { var slot = entry.Key; if (entry.Value.Range < 5000f) { menu.AddItem(new MenuItem(ObjectManager.Player.ChampionName + "Draw" + GetStringFromSpellSlot(slot), "Draw " + GetStringFromSpellSlot(slot)).SetValue(new Circle(true, myColor))); } } }
public static void AddKeyBind(this Menu menu, string path, string text, string key, KeyBindType type) { try { menu.AddItem( new MenuItem("apollo.leblanc." + path, text).SetValue(new KeyBind(key.ToCharArray()[0], type))); } catch (Exception e) { Console.WriteLine(e); } }
public static void Closure( this ItemSet itemset,cfg cfg, FirstSet first) { HashSet<Production> productions = cfg.Productions; bool changed; do { changed = false; char end = System.Configuration.ConfigurationManager.AppSettings["End"][0]; for (int i = 0; i < itemset.Count; ++i) { Item item = itemset.ElementAt(i); int index = item.Index; string right = item.Production.Right; if (index >= right.Length || !cfg.isVn(right[index])) { continue; } foreach (Production production in productions) { if (production.Left != right[index]) { continue; } int length = right.Length; if (index + 1 == right.Length) { Item newItem = new Item(production, 0,item.Symbol); changed |= itemset.AddItem(newItem); continue; } if (index + 1 < right.Length) { char empty = System.Configuration.ConfigurationManager.AppSettings["Empty"][0]; HashSet<char> symbols = first.GetFirst(right[index + 1]); foreach (char c in symbols) { if (c == empty) { Item newItem = new Item(production, 0, item.Symbol); changed |= itemset.Add(newItem); } else { Item newItem = new Item(production, 0, c); changed |= itemset.Add(newItem); } } } } } } while (changed); }
public static void AddModeMenu(this Menu menu, Mode mode, SpellSlot[] spellList, bool[] values) { for (var i = 0; i < spellList.Count(); i++) { menu.AddItem( new MenuItem( "com.idzlucian.use" + GetStringFromSpellSlot(spellList[i]).ToLowerInvariant() + GetStringFromMode(mode), "Use " + GetStringFromSpellSlot(spellList[i]) + " " + GetFullNameFromMode(mode)).SetValue( values[i])); } }
public static void AddHitChance(this Menu menu, string path, int minimumHitchance = 2) { try { menu.AddItem( new MenuItem("apollo.leblanc." + path, "Minimum HitChance").SetValue( new StringList((new[] { "Low", "Medium", "High", "Very High" }), minimumHitchance))); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public static ContextMenu AddTextBoxItems(this ContextMenu menu) { if (!menu.Items.IsEmpty) { menu.AddSeparator(); } return menu .AddItem(ApplicationCommands.Undo) .AddSeparator() .AddItem(ApplicationCommands.Cut) .AddItem(ApplicationCommands.Copy) .AddItem(ApplicationCommands.Paste) .AddItem(ApplicationCommands.Delete) .AddSeparator() .AddItem(ApplicationCommands.SelectAll); }
public static List<MenuItem> AddChampMenu(this Menu mainMenu, bool defValue) { var champsList = new List<MenuItem>(); var baseName = mainMenu.Name.ToLower(); // ReSharper disable once LoopCanBeConvertedToQuery foreach (var champion in GameObjects.EnemyHeroes) { var champItem = new MenuItem($"{baseName}.{champion.ChampionName.ToLower()}", champion.ChampionName).SetValue(defValue); mainMenu.AddItem(champItem); champsList.Add(champItem); } return champsList; }
public static EntityType AddTable(this EdmModel database, string name) { DebugCheck.NotEmpty(name); var uniqueIdentifier = database.EntityTypes.UniquifyName(name); var table = new EntityType( uniqueIdentifier, DefaultStoreNamespace, DataSpace.SSpace); database.AddItem(table); database.AddEntitySet(table.Name, table, uniqueIdentifier); return table; }
/// <summary> /// Creates the and add function. /// </summary> /// <param name="item">The item.</param> /// <param name="name">The name.</param> /// <param name="parameters">The parameters.</param> /// <param name="returnValues">The return values.</param> /// <param name="body">The body.</param> /// <returns></returns> public static EdmFunction CreateAndAddFunction( this EdmModel item, string name, IList<FunctionParameter> parameters, IList<FunctionParameter> returnValues, string body = null ) { var payload = new EdmFunctionPayload { StoreFunctionName = name, Parameters = parameters, ReturnParameters = returnValues, Schema = item.GetDefaultSchema() }; EdmFunction function = EdmFunction.Create( name, item.GetDefaultNamespace(), item.DataSpace, payload, null ); item.AddItem( function ); return function; }
public static EdmFunction AddFunction(this EdmModel database, string name, EdmFunctionPayload functionPayload) { DebugCheck.NotNull(database); DebugCheck.NotEmpty(name); var uniqueIdentifier = database.Functions.UniquifyName(name); var function = new EdmFunction( uniqueIdentifier, DefaultStoreNamespace, DataSpace.SSpace, functionPayload); database.AddItem(function); return function; }