public void TestCreateMenu() { var html = Properties.Resources.JustEatMenuUnitTest; Menu menu = new MenuFactory().CreateMenu(html); Assert.AreEqual(menu.Categories.Keys.First(), "Pizzaer"); }
public ZoomHack(MenuFactory MenuFactory, Lazy <IInputManager> inputmanager) { InputManage = inputmanager; var ZoomHackMenu = MenuFactory.Menu("Zoom Hack"); ZoomKeyItem = ZoomHackMenu.Item("Key", new KeyBind(0x11, KeyBindType.Press)); ZoomSliderItem = ZoomHackMenu.Item("Camera Distance", new Slider(DefaultZoomValue, MinZoomValue, MaxZoomValue)); ZoomVar = Game.GetConsoleVar("dota_camera_distance"); ZoomVar.SetValue(ZoomSliderItem.Value); RVar = Game.GetConsoleVar("r_farz"); RVar.SetValue(18000); ZoomSliderItem.PropertyChanged += ZoomSliderItemChanged; InputManage.Value.MouseWheel += InputManagerMouseWheel; Game.ExecuteCommand("dota_camera_disable_zoom true"); }
public Config(OverlayInformation overlayInformation) { Factory = MenuFactory.Create("Overlay Information"); Factory.Target.SetFontColor(Color.YellowGreen); Main = overlayInformation; TopPanel = new TopPanel(this); HeroOverlay = new HeroOverlay(this); CourEsp = new CourEsp(this); ItemPanel = new ItemPanel(this); NetworthPanel = new NetworthPanel(this); ShrineHelper = new ShrineHelper(this); TpCatcher = new TpCatcher(this); LastPositionTracker = new LastPositionTracker(this); OpenDotaHelper = new OpenDotaHelper(this); ShowMeMore = new ShowMeMore(this); GlyphTracker = new GlyphTracker(this); RoshanTimer = new RoshanTimer(this); ShowIllusions = new ShowIllusions(this); }
public async Task Start() { var user = new User { Age = 20 }; var task1 = LongOperationAsync(user); var allowedToDrink = AllowedToDrink(user) ? "Yes" : "No"; var valueFromTask1 = await task1; var resultInfo = new List <string> { $"How old is the user: {valueFromTask1}", $"Can the user drink: {allowedToDrink}" }; MenuFactory.SimpleMessagesInformational(resultInfo).Display(); }
public Configuration(Menu root) { ComboMenu = MenuFactory.CreateMenu(root, "Combo"); HarassMenu = MenuFactory.CreateMenu(root, "Harass"); LaneClearMenu = MenuFactory.CreateMenu(root, "Lane Clear"); JungleClearMenu = MenuFactory.CreateMenu(root, "Jungle Clear"); MiscMenu = MenuFactory.CreateMenu(root, "Misc"); SkinMenu = MenuFactory.CreateMenu(root, "Skin Menu"); UltimateMenu = MenuFactory.CreateMenu(root, "Ultimate Menu"); DrawingMenu = MenuFactory.CreateMenu(root, "Drawing"); Combos(MenuItemFactory.Create(ComboMenu)); Harass(MenuItemFactory.Create(HarassMenu)); LaneClear(MenuItemFactory.Create(LaneClearMenu)); JungleClear(MenuItemFactory.Create(JungleClearMenu)); Misc(MenuItemFactory.Create(MiscMenu)); Skins(MenuItemFactory.Create(SkinMenu)); Ultimate(MenuItemFactory.Create(UltimateMenu)); Drawings(MenuItemFactory.Create(DrawingMenu)); }
public IEnumerable <MenuItem> GetItems(string areaName, ControllerContext controllerContext) { var siteName = controllerContext.RequestContext.GetRequestValue("siteName"); if (!string.IsNullOrEmpty(siteName)) { var site = SiteHelper.Parse(siteName).AsActual(); if (site != null) { var repository = site.GetRepository(); if (repository != null) { areaName = "Contents"; var items = MenuFactory.BuildMenu(controllerContext, areaName, false).Items; ResetRouteValues(siteName, repository.Name, areaName, items); return(items); } } } return(new MenuItem[0]); }
public IEnumerable <Permission> GetModulePermissions() { var modules = All(); List <Permission> permissions = new List <Permission>(); foreach (var moduleName in modules) { var menuTemplate = MenuFactory.GetMenuTemplate(moduleName); if (menuTemplate != null) { foreach (var item in menuTemplate.ItemContainers) { if (item is MenuItemTemplate) { FetchPermissions(moduleName, (MenuItemTemplate)item, permissions); } } } } return(permissions); }
public void Activate() { this.menu = this.mainMenu.InformationMenu.Menu("Items"); this.information = this.menu.Item("Get", false); this.information.PropertyChanged += this.InformationOnPropertyChanged; this.autoUpdate = this.menu.Item("Auto update", false); this.autoUpdate.PropertyChanged += this.AutoUpdateOnPropertyChanged; this.showInventory = this.menu.Item("Show inventory items", true); this.showBackpack = this.menu.Item("Show backpack items", false); this.showStash = this.menu.Item("Show stash items", false); this.showManaCost = this.menu.Item("Show mana cost", false); this.showCastRange = this.menu.Item("Show cast range", false); this.showBehavior = this.menu.Item("Show behavior", false); this.showTargetType = this.menu.Item("Show target type", false); this.showSpecialData = this.menu.Item("Show all special data", false); this.AutoUpdateOnPropertyChanged(null, null); }
public void Activate() { this.menu = this.mainMenu.InformationMenu.Menu("Spells"); this.information = this.menu.Item("Get", false); this.information.PropertyChanged += this.InformationOnPropertyChanged; this.autoUpdate = this.menu.Item("Auto update", false); this.autoUpdate.PropertyChanged += this.AutoUpdateOnPropertyChanged; this.showHidden = this.menu.Item("Show hidden", false); this.showTalents = this.menu.Item("Show talents", false); this.showLevel = this.menu.Item("Show levels", false); this.showManaCost = this.menu.Item("Show mana cost", false); this.showCastRange = this.menu.Item("Show cast range", false); this.showBehavior = this.menu.Item("Show behavior", false); this.showTargetType = this.menu.Item("Show target type", false); this.showSpecialData = this.menu.Item("Show all special data", false); this.AutoUpdateOnPropertyChanged(null, null); }
public ConsoleCommands(MenuFactory MenuFactory) { var ConsoleCommandsMenu = MenuFactory.Menu("Console Commands"); FogItem = ConsoleCommandsMenu.Item("Fog Disable", true); FilteringItem = ConsoleCommandsMenu.Item("Filtering Disable", true); ParticleHackItem = ConsoleCommandsMenu.Item("Particle Hack Enable", true); Fog = Game.GetConsoleVar("fog_enable"); Fog.SetValue(Convert.ToInt32(!FogItem.Value)); Filtering = Game.GetConsoleVar("fow_client_nofiltering"); Filtering.SetValue(Convert.ToInt32(FilteringItem.Value)); ParticleHack = Game.GetConsoleVar("dota_use_particle_fow"); ParticleHack.SetValue(Convert.ToInt32(!ParticleHackItem.Value)); FogItem.PropertyChanged += FogItemChanged; FilteringItem.PropertyChanged += FilteringItemChanged; ParticleHackItem.PropertyChanged += ParticleHackItemChanged; }
public void Should_update_menu() { var command = new SetMenuItemPermissions { SiteId = Guid.NewGuid(), MenuId = Guid.NewGuid(), MenuItemId = Guid.NewGuid() }; var menu = MenuFactory.Menu(command.SiteId, command.MenuId, "Name", "Item", "Item", command.MenuItemId); var repositoryMock = new Mock <IMenuRepository>(); repositoryMock.Setup(x => x.GetById(command.SiteId, command.MenuId)).Returns(menu); var setMenuModulePermissionsHandler = new SetMenuItemPermissionsHandler(repositoryMock.Object); setMenuModulePermissionsHandler.Handle(command); repositoryMock.Verify(x => x.Update(It.IsAny <Menu>())); }
public ActionResult ExcluirMenu(MenuModelView menu) { if (menu == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (!ModelState.IsValid) { ViewBag.Role = new SelectList(roleDAO.List(), "Id", "Description", menu.Role); return(View(menu)); } var model = MenuFactory.BuildModel(menu); model.Role = roleDAO.GetById(menu.Role); menuDAO.Delete(model); return(RedirectToAction("IndexMenus")); }
public void Activate() { this.menu = this.mainMenu.InformationMenu.Menu("Units"); this.information = this.menu.Item("Get", false); this.information.PropertyChanged += this.InformationOnPropertyChanged; this.autoUpdate = this.menu.Item("Auto update", false); this.autoUpdate.PropertyChanged += this.AutoUpdateOnPropertyChanged; this.showTeam = this.menu.Item("Show team", true); this.showLevel = this.menu.Item("Show level", true); this.showsHpMp = this.menu.Item("Show hp/mp", true); this.showVision = this.menu.Item("Show vision", true); this.showState = this.menu.Item("Show state", true); this.showsAbilityInfo = this.menu.Item("Show ability information", false); this.showItemInfo = this.menu.Item("Show item information", false); this.showModifierInfo = this.menu.Item("Show modifier information", false); this.AutoUpdateOnPropertyChanged(null, null); }
public DarkWillowConfiguration() { var itemDict1 = new Dictionary <string, bool> { { "item_bloodthorn", true }, { "item_orchid", true }, { "item_solar_crest", true }, { "item_medallion_of_courage", true }, { "item_sheepstick", true } }; var itemDict2 = new Dictionary <string, bool> { { "item_rod_of_atos", true }, { "item_blink", true }, { "item_mjollnir", true }, { "item_veil_of_discord", true } }; var spellDict = new Dictionary <string, bool> { { "dark_willow_bramble_maze", true }, // {"dark_willow_shadow_realm", true }, { "dark_willow_cursed_crown", true }, { "dark_willow_bedlam", true } // {"dark_willow_terrorize", true } }; this.Menu = MenuFactory.Create("Dark Willow"); this.Key = this.Menu.Item("Combo Key", new KeyBind(32)); this.Target = Menu.Item("Target", new StringList("Lock", "Default")); this.UseBlink = this.Menu.Item("Blink Prediction", new Slider(475, 475, 500)); this.AbilityToggler = this.Menu.Item("Ability Toggler", new AbilityToggler(spellDict)); this.ItemToggler = this.Menu.Item("Item Toggler", new AbilityToggler(itemDict1)); this.ItemToggler2 = this.Menu.Item("", new AbilityToggler(itemDict2)); }
public Configuration(string ownerName) { var itemTab = new List <AbilityId> { AbilityId.item_medallion_of_courage, AbilityId.item_solar_crest, AbilityId.item_sheepstick, AbilityId.item_diffusal_blade, AbilityId.item_nullifier, AbilityId.item_orchid, AbilityId.item_bloodthorn, AbilityId.item_mjollnir }; var spellTab = new List <AbilityId> { AbilityId.clinkz_death_pact, AbilityId.clinkz_searing_arrows, AbilityId.clinkz_strafe }; MFactory = MenuFactory.CreateWithTexture("Clinkz", ownerName); DrawTargetParticle = MFactory.Item("Draw target particle", true); ComboKey = MFactory.Item("Combo Key", new KeyBind(32)); var itemMenu = MFactory.Menu("Item Manager"); ItemManager = itemMenu.Item("Item Toggler: ", new AbilityToggler(itemTab.ToDictionary(x => x.ToString(), x => true))); var abilityMenu = MFactory.Menu("Ability Manager"); AbilityManager = abilityMenu.Item("Ability Toggler: ", new AbilityToggler(spellTab.ToDictionary(x => x.ToString(), x => true))); }
/// <summary> /// Initializing the menu items /// </summary> /// <returns></returns> private bool InitializeMenu() { try { string maintoolbarResource = ApplicationMain.manifestNamespace + "DefaultToolbarItems.xml"; string menuResource = ApplicationMain.manifestNamespace + "DefaultMenuItems.xml"; FactoryType ft; #if SyncfusionFramework2_0 ft = FactoryType.WhidbeyMenuFactory; #else ft = FactoryType.WinFormsMenuFactory; #endif menuFactory = MenuLoader.CreateFactory(ft, ApplicationMain.menuNamespace, new string[] { maintoolbarResource }, new string[] { menuResource }, ApplicationMain.IconResources, this); if (menuFactory.ToolBars != null) { this.Controls.AddRange(menuFactory.ToolBars as Control[]); } if (menuFactory.Menus != null) { if (typeof(Menu).IsInstanceOfType(menuFactory.Menus[0])) { Menu = menuFactory.Menus[0] as MainMenu; } else { this.Controls.Add(menuFactory.Menus[0] as Control); } } } catch (Exception ex) { Trace.WriteLine("Unable to create menu factory due to the following error:"); Trace.WriteLine(ex.ToString()); return(false); } return(true); }
public WeatherHack(MenuFactory MenuFactory) { var WeatherHackMenu = MenuFactory.Menu("Weather Hack"); WeatherItem = WeatherHackMenu.Item("Selected", new StringList(new[] { "Default", "Snow", "Rain", "Moonbeam", "Pestilence", "Harvest", "Sirocco", "Ash", "Aurora" })); Weather = Game.GetConsoleVar("cl_weather"); Weather.SetValue(WeatherItem.Value.SelectedIndex); WeatherItem.PropertyChanged += WeatherItemChanged; }
public AutoAttackModeConfig(MenuFactory parent, string name, uint key, bool hero, bool creep, bool neutral, bool building, bool deny, bool lasthit) { this.Factory = parent.Menu(name); this.Active = this.Factory.Item("Active", true); this.Key = this.Factory.Item("Key", new KeyBind(key)); this.Deny = this.Factory.Item("Deny", deny); this.Deny.Item.Tooltip = "Deny creeps"; this.Farm = this.Factory.Item("Lasthit", lasthit); this.Farm.Item.Tooltip = "Last hit creeps"; this.Hero = this.Factory.Item("Hero", hero); this.Hero.Item.Tooltip = "Attack heroes"; this.Building = this.Factory.Item("Building", building); this.Building.Item.Tooltip = "Attack buildings"; this.Neutral = this.Factory.Item("Neutral", neutral); this.Neutral.Item.Tooltip = "Attack neutral creeps"; this.Creep = this.Factory.Item("Creep", creep); this.Creep.Item.Tooltip = "Attack creeps"; this.BonusMeleeRange = this.Factory.Item("Bonus Melee Range", new Slider(0, 0, 400)); this.BonusRangedRange = this.Factory.Item("Bonus Ranged Range", new Slider(0, 0, 400)); }
static void Main(string[] args) { string input = ""; Console.WriteLine("To quit, press q."); IMenu menu = new MenuFactory().Create(); while (true) { Console.Write("Please, input your order: "); input = Console.ReadLine(); if (input.ToLower() == "q") { break; } Ordering ordering = new Ordering(menu); string resultMessage = ordering.Order(input); Console.WriteLine("Output: " + resultMessage); } }
private void BuildOptionsMenu() { bool restricted = Pager.CurrentPage == AbstractPage.Pages.Welcome || Pager.CurrentPage == AbstractPage.Pages.DeviceSelect || !BluetoothImpl.Instance.RegisteredDeviceValid; var options = new Dictionary <string, EventHandler <RoutedEventArgs>?>() { [Loc.Resolve("optionsmenu_settings")] = (sender, args) => Pager.SwitchPage(AbstractPage.Pages.Settings), [Loc.Resolve("optionsmenu_refresh")] = async(sender, args) => await BluetoothImpl.Instance.SendRequestAsync(SPPMessage.MessageIds.DEBUG_GET_ALL_DATA), [Loc.Resolve("optionsmenu_deregister")] = (sender, args) => BluetoothImpl.Instance.UnregisterDevice() .ContinueWith((_) => Pager.SwitchPage(AbstractPage.Pages.Welcome)) }; if (restricted) { options.Clear(); } options[Loc.Resolve("optionsmenu_update")] = async(sender, args) => { var result = await UpdateManager.Instance.DoManualCheck(); if (result != UpdateStatus.UpdateAvailable) { await new MessageBox() { Title = Loc.Resolve("updater_noupdate_title"), Description = Loc.Resolve("updater_noupdate"), }.ShowDialog(this); } }; options[Loc.Resolve("optionsmenu_credits")] = (sender, args) => Pager.SwitchPage(AbstractPage.Pages.Credits); _titleBar.OptionsButton.ContextMenu = MenuFactory.BuildContextMenu(options); }
/// <summary> /// 主菜单控制器 /// </summary> public BaseController() { //获取顶部后台菜单信息分类 MenuFactory menufactory = new MenuFactory(); List <IMenuB> lstMenu = menufactory.GetDataMenu(); List <MenuM> MenuInfo = new List <MenuM>(); lstMenu.ForEach(p => MenuInfo.Add(p.Infomation_menu)); ViewBag.BaseController = MenuInfo; ////获取model表信息 //ModelColFactory modelcolfactory = new ModelColFactory(); //List<IModelB> lstModel = modelcolfactory.AllGetData(); //List<ModelM> ModelInfoCol = new List<ModelM>(); //if (lstModel != null && lstModel.Count > 0) lstModel.ForEach(p => ModelInfoCol.Add(p.Infomation)); //ViewBag.ModelInfoCol = ModelInfoCol; ////提示消息 //PromptColFactory promptcolfactory = new PromptColFactory(); //List<IPromptB> lst = promptcolfactory.GetData(); //List<PromptM> PromptInfoCol = new List<PromptM>(); //if (lst != null && lst.Count > 0) lst.ForEach(p => PromptInfoCol.Add(p.Infomation)); //ViewBag.PromptInfoCol = PromptInfoCol; }
public void Activate() { this.menu = this.mainMenu.CheatsMenu.Menu("Create unit"); this.randomAlly = this.menu.Item("Random ally hero", new KeyBind(103)); this.randomAlly.PropertyChanged += this.RandomAllyOnPropertyChanged; this.meleeAllyCreep = this.menu.Item("Melee ally creep", new KeyBind(104)); this.meleeAllyCreep.PropertyChanged += this.MeleeAllyCreepOnPropertyChanged; this.rangedAllyCreep = this.menu.Item("Ranged ally creep", new KeyBind(105)); this.rangedAllyCreep.PropertyChanged += this.RangedAllyCreepOnPropertyChanged; this.randomEnemy = this.menu.Item("Random enemy hero", new KeyBind(100)); this.randomEnemy.PropertyChanged += this.RandomEnemyOnPropertyChanged; this.meleeEnemyCreep = this.menu.Item("Melee enemy creep", new KeyBind(101)); this.meleeEnemyCreep.PropertyChanged += this.MeleeEnemyCreepOnPropertyChanged; this.rangedEnemyCreep = this.menu.Item("Ranged enemy creep", new KeyBind(102)); this.rangedEnemyCreep.PropertyChanged += this.RangedEnemyCreepOnPropertyChanged; }
private MenuItem GetModuleMenuItem(string moduleName, ControllerContext controllerContext) { MenuItem root; var items = MenuFactory.BuildMenu(controllerContext, moduleName, false).Items; if (items.Count == 1 && items.First().Name.ToLower() == "root") { root = items.First(); } else { root = new MenuItem() { Text = moduleName, Action = "", Controller = "", HtmlAttributes = new System.Web.Routing.RouteValueDictionary(), RouteValues = new System.Web.Routing.RouteValueDictionary() }; root.Items = items; } Initialize(moduleName, root); return(root); }
public Config() { Factory = MenuFactory.CreateWithTexture("VisibleByEnemyPlus", "visiblebyenemyplus"); Factory.Target.SetFontColor(Color.Aqua); EffectTypeItem = Factory.Item("Effect Type", new StringList(EffectsName) { SelectedIndex = 0 }); RedItem = Factory.Item("Red", new Slider(255, 0, 255)); GreenItem = Factory.Item("Green", new Slider(255, 0, 255)); BlueItem = Factory.Item("Blue", new Slider(255, 0, 255)); AlphaItem = Factory.Item("Alpha", new Slider(255, 0, 255)); if (EffectTypeItem.Value.SelectedIndex == 0) { RedItem.Item.SetFontColor(Color.Black); GreenItem.Item.SetFontColor(Color.Black); BlueItem.Item.SetFontColor(Color.Black); AlphaItem.Item.SetFontColor(Color.Black); } else { RedItem.Item.SetFontColor(new Color(RedItem, 0, 0, 255)); GreenItem.Item.SetFontColor(new Color(0, GreenItem, 0, 255)); BlueItem.Item.SetFontColor(new Color(0, 0, BlueItem, 255)); AlphaItem.Item.SetFontColor(new Color(185, 176, 163, AlphaItem)); } AlliedHeroesItem = Factory.Item("Allied Heroes", true); WardsItem = Factory.Item("Wards", true); MinesItem = Factory.Item("Mines", true); ShrinesItem = Factory.Item("Shrines", true); ShrinesDrawItem = Factory.Item("Shrines Draw On Minimap", true); NeutralsItem = Factory.Item("Neutrals", true); UnitsItem = Factory.Item("Units", true); BuildingsItem = Factory.Item("Buildings", true); }
public void StatusScreenCorrectlyDisplaysTerrainInteractableInformation_Bells() { ChanceService chanceService = new ChanceService(); MenuFactory menuFactory = new MenuFactory(); List <TerrainInteractable> bells = new List <TerrainInteractable> { new Bell("copper bell", BellType.Copper, menuFactory, chanceService), new Bell("silver bell", BellType.Silver, menuFactory, chanceService) }; SetUpAndBuildMenu(true, terrainInteractable: bells); _menuInput.Push("status"); _menuInput.Push("back"); _menu.GetInput(); var outputs = _menuOutput.GetOutputs(); var clearIndices = _menuOutput.GetClearIndices(); var expectedLength = _fullMenuPromptLength * 2; //times 2 because it's displayed twice expectedLength += FighterStatusPromptLength; //no spells expectedLength += 2; //"Foes" header and one foe listed expectedLength += 3; //"Other" header and both bells listed Assert.AreEqual(expectedLength, outputs.Length); Assert.AreEqual(5, clearIndices.Length); //once for each main menu, once after each human fighter (just 1), one after enemy display, one after bells displayed var index = _fullMenuPromptLength + FighterStatusPromptLength + 2; //2 for the foes and enemy display information Assert.AreEqual("Other details:\n", outputs[index++].Message); foreach (TerrainInteractable bell in bells) { Assert.AreEqual($"{bell.GetFullDisplayString()}\n", outputs[index++].Message); } }
public Config(EnigmaPlus enigmaplus) { EnigmaPlus = enigmaplus; Factory = MenuFactory.CreateWithTexture("EnigmaPlus", "npc_dota_hero_enigma"); Factory.Target.SetFontColor(Color.Aqua); var AbilitiesMenu = Factory.Menu("Abilities"); AbilityToggler = AbilitiesMenu.Item("Use: ", new AbilityToggler(new Dictionary <string, bool> { { "enigma_black_hole", true }, { "enigma_midnight_pulse", true }, })); var ItemsMenu = Factory.Menu("Items"); ItemsToggler = ItemsMenu.Item("Use: ", new AbilityToggler(new Dictionary <string, bool> { { "item_refresher", true }, { "item_veil_of_discord", true }, { "item_shivas_guard", true }, { "item_black_king_bar", true }, { "item_glimmer_cape", true }, { "item_guardian_greaves", true }, { "item_arcane_boots", true }, { "item_soul_ring", true }, { "item_blink", true } })); var DrawingMenu = Factory.Menu("Drawing"); ComboRadiusItem = DrawingMenu.Item("Combo Stable Radius", true); ComboRadiusItem.Item.SetTooltip("I suggest making a combo in this radius"); AmountItem = Factory.Item("Amount", new Slider(2, 1, 5)); ComboKeyItem = Factory.Item("Combo Key", new KeyBind('D')); }
public void Activate() { if (this.IsActive) { return; } this.IsActive = true; Log.Debug($"Activate Orbwalker: {this.Owner.GetDisplayName()}"); this.Settings = new OrbwalkerSettings(MenuFactory.Attach("Orbwalker"), this.Owner); this.Settings.DrawRange.PropertyChanged += this.OnDrawRangeChanged; this.Settings.DrawHoldRange.PropertyChanged += this.OnDrawHoldRangeChanged; if (this.Settings.DrawRange || this.Settings.DrawHoldRange) { UpdateManager.Subscribe(this.OnUpdateDrawings, 1000); } Entity.OnInt32PropertyChange += this.OnNetworkActivity; this.Inventory.Value.CollectionChanged += this.OnItemsChanged; }
public void Should_save_new_menu() { var newMenu = MenuFactory.Menu(_siteId, Guid.NewGuid(), "Menu 3", "Item", ""); var newMenuDbEntity = new MenuDbEntity { SiteId = newMenu.SiteId, Id = newMenu.Id, Name = newMenu.Name }; var mapperMock = new Mock <IMapper>(); mapperMock.Setup(x => x.Map <MenuDbEntity>(newMenu)).Returns(newMenuDbEntity); mapperMock.Setup(x => x.Map <Menu>(newMenuDbEntity)).Returns(newMenu); _sut = new MenuRepository(_dbContext, mapperMock.Object); _sut.Create(newMenu); var actual = _sut.GetById(_siteId, newMenu.Id); Assert.NotNull(actual); }
public GameContext(Microsoft.Xna.Framework.Game game, SpriteBatch spriteBatch, IScreenSizeManager screenSizeManager, IGameAudioManager gameAudioManager) { _game = game ?? throw new ArgumentNullException(nameof(game)); if (spriteBatch == null) { throw new ArgumentNullException(nameof(spriteBatch)); } if (screenSizeManager == null) { throw new ArgumentNullException(nameof(screenSizeManager)); } GameGraphics = new GameGraphics(spriteBatch, screenSizeManager, new TrackingCamera2D(this) { Zoom = 1f }); GameAudio = gameAudioManager ?? throw new ArgumentNullException(nameof(gameAudioManager)); Random = new Random(); AssetManager = new AssetManager(_game); StateMachine = new GameStateMachine(); MenuFactory = new MenuFactory(this); CollisionSystem = new BasicCollisionSystem(); NotificationMediator = new NotificationMediator(); }
public ShamanConfig() { var itemDict = new Dictionary <string, bool> { { "item_bloodthorn", true }, { "item_sheepstick", true }, { "item_shivas_guard", true }, { "item_dagon_5", true }, { "item_hurricane_pike", true }, { "item_blink", true }, { "item_orchid", true }, { "item_rod_of_atos", true }, { "item_veil_of_discord", true }, { "item_mjollnir", true }, { "item_cyclone", true } }; var spellDict = new Dictionary <string, bool> { { "shadow_shaman_ether_shock", true }, { "shadow_shaman_voodoo", true }, { "shadow_shaman_shackles", true }, { "shadow_shaman_mass_serpent_ward", true } }; this.Menu = MenuFactory.Create("ShadowShamanSharp"); this.Key = this.Menu.Item("Combo Key", new KeyBind(32)); this.Key.Item.Tooltip = "Hold this key to start combo mode."; this.KillStealEnabled = this.Menu.Item("Killsteal toggle", true); this.KillStealEnabled.Item.Tooltip = "Setting this to false will disable killsteal."; this.FailSwitch = this.Menu.Item("Fail Switch", false); this.FailSwitch.Item.Tooltip = "Will stop if can't ward trap"; this.UseBlinkPrediction = this.Menu.Item("Blink Prediction", new Slider(200, 0, 600)); this.UseBlinkPrediction.Item.Tooltip = "Will blink to set distance. Set to 0 if you want to disable it."; this.AbilityToggler = this.Menu.Item("Ability Toggler", new AbilityToggler(spellDict)); this.ItemToggler = this.Menu.Item("Item Toggler", new AbilityToggler(itemDict)); }
public OdSharpConfig() { var itemDict = new Dictionary <string, bool> { { "item_bloodthorn", true }, { "item_sheepstick", true }, { "item_shivas_guard", true }, { "item_hurricane_pike", true }, { "item_blink", true }, { "item_orchid", true }, { "item_rod_of_atos", true }, { "item_veil_of_discord", true }, }; var spellDict = new Dictionary <string, bool> { { "obsidian_destroyer_arcane_orb", true }, { "obsidian_destroyer_astral_imprisonment", true }, { "obsidian_destroyer_sanity_eclipse", true } }; this.Menu = MenuFactory.Create("ODSharpSDK"); this.Key = this.Menu.Item("Combo Key", new KeyBind(32)); this.Key.Item.Tooltip = "Hold this key to start combo mode."; this.KillStealEnabled = this.Menu.Item("Killsteal toggle", true); this.KillStealEnabled.Item.Tooltip = "Setting this to false will disable killsteal."; this.UseBlinkPrediction = this.Menu.Item("Blink Prediction", new Slider(200, 0, 600)); this.UseBlinkPrediction.Item.Tooltip = "Will blink to set distance. Set to 0 if you want to disable it."; this.Drawings = this.Menu.Item("Enable Ulti damage drawings", true); this.MinimumTargetToUlti = this.Menu.Item("Ulti Target Count", new Slider(1, 1, 5)); this.MinimumTargetToUlti.Item.Tooltip = "Minimum required enemy heroes to cast ulti. Atleast 1 of them should die too."; this.HurricanePercentage = this.Menu.Item("Hurricane Usage Percent", new Slider(20, 0, 100)); this.AbilityToggler = this.Menu.Item("Ability Toggler", new AbilityToggler(spellDict)); this.ItemToggler = this.Menu.Item("Item Toggler", new AbilityToggler(itemDict)); }
static void Main(string[] args) { var test = new MenuFactory().CreateMenu(Just_Search_UnitTest.Properties.Resources.JustEatMenuUnitTest); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); menuFactory = new MenuFactory(); // Create your application here CreateMenu(); SetContentView(GetHomeLayout()); }