private void FilterNotes(string filterString) { if (string.IsNullOrEmpty(filterString)) { FileItems.Clear(); foreach (var item in AllItems) { FileItems.Add(item); } } else { FileItems.Clear(); var items = AllItems.Where(p => p.Name.ToLower().Contains(filterString)); foreach (var item in items) { FileItems.Add(item); } } if (FileItems.Count > 0) { ItemsSelectedIndex = 0; filesList.SelectedIndex = ItemsSelectedIndex; } }
private Task <QueryData <EditFooTree> > OnQueryAsync(QueryPageOptions _) { return(Task.FromResult(new QueryData <EditFooTree>() { Items = AllItems.Where(f => f.ParentId == 0) })); }
private static List <Item> GetItemListBySearchType(string searchText, int ItemVar) { List <Item> ReturnList = new List <Item>(); switch (ItemVar) { case 1: //Name ReturnList = AllItems.Where(x => x.Name.Contains(searchText.ToUpper())).ToList(); break; case 2: //Model ReturnList = AllItems.Where(x => x.Model.Contains(searchText.ToUpper())).ToList(); break; case 3: //RackID ReturnList = AllItems.Where(x => x.RackId.Contains(searchText.ToUpper())).ToList(); break; case 4: //Volts ReturnList = AllItems.Where(x => x.Volts.Contains(searchText.ToUpper())).ToList(); break; case 5: //SerialNum ReturnList = AllItems.Where(x => x.SerialNum.Contains(searchText.ToUpper())).ToList(); break; } return(ReturnList); }
private void OpenSettings_Click(object sender, RoutedEventArgs e) { Console.WriteLine("Opening Settings File..."); OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = System.Windows.Forms.Application.StartupPath; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Console.WriteLine(" " + openFileDialog.FileName); SettingsFile = Settings.LoadFromFile(openFileDialog.FileName); AllItems.Clear(); foreach (Item item in SettingsFile.BasicAugments.Concat(SettingsFile.CoreAugs).Concat(SettingsFile.PrimaryWeapons).Concat(SettingsFile.Prototypes)) { AllItems.Add(item); } List <Item> removeItems = AllItems.Where((item) => item.Name == String.Empty || item.Lockable == false).ToList(); foreach (Item item in removeItems) { AllItems.Remove(item); // <-- remove placeholders and non-lockable items } SettingsPathToUse = openFileDialog.FileName; Console.WriteLine(" File Opened."); } }
public override InteractResult OnActRight(InteractionContext context) { if (string.IsNullOrEmpty(this.wantedItem)) { this.wantedItem = DiscoveryManager.Obj.GetRandomDiscoveredNotCarriedItem().DisplayName; } var itemStack = context.Player.User.Inventory.NonEmptyStacks.Where(stack => stack.Item.DisplayName == this.wantedItem).FirstOrDefault(); if (itemStack != null) { var gift = AllItems.Where(x => !(x is Skill) && x.Group != "Actionbar Items").Shuffle().First(); var result = context.Player.User.Inventory.TryModify(changeSet => { changeSet.RemoveItem(itemStack.Item.Type); changeSet.AddItem(gift.Type); }, context.Player.User); if (result.Success) { context.Player.Msg(Localizer.Format("Ecko accepts your tribute of {0:wanted} and grants you {1:given} for your devotion.", this.wantedItem, gift.DisplayName)); this.wantedItem = DiscoveryManager.Obj.GetRandomDiscoveredNotCarriedItem().DisplayName; } } else { context.Player.Msg(Localizer.Format("Ecko demands {0}!", this.wantedItem)); } return(base.OnActLeft(context)); }
public override InteractResult OnActRight(InteractionContext context) { if (this.wantedItem == string.Empty) { this.wantedItem = SearchAndSelectItemSets.DiscoveredItems.Items.Shuffle().First().FriendlyName; } var itemStack = context.Player.User.Inventory.NonEmptyStacks.Where(stack => stack.Item.FriendlyName == this.wantedItem).FirstOrDefault(); if (itemStack != null) { var gift = AllItems.Where(x => !(x is Skill) && x.Group != "Actionbar Items").Shuffle().First(); var result = context.Player.User.Inventory.TryModify(changeSet => { changeSet.RemoveItem(itemStack.Item.Type); changeSet.AddItem(gift.Type); }, context.Player.User); if (result.Success) { context.Player.SendTemporaryMessage(FormattableStringFactory.Create("Ecko accepts your tribute of {0:wanted} and grants you {1:given} for your devotion.", this.wantedItem, gift.FriendlyName)); this.wantedItem = SearchAndSelectItemSets.DiscoveredItems.Items.Shuffle().First().FriendlyName; } } else { context.Player.SendTemporaryMessage(FormattableStringFactory.Create("Ecko demands {0:wanted}!", this.wantedItem)); } return(InteractResult.Success); }
public IEnumerable <RigOapChecklistQuestionNoAnswerComment> GetOpenNoAnswers(int oapChecklistId, int oapChecklistQuestionId) { var items = AllItems.Where( n => n.OapChecklistId == oapChecklistId && n.OapChecklistQuestionId == oapChecklistQuestionId && n.EndDateTime == null) .ToList(); return(items); }
public InventoryCache() { GameEvents.OnGameJoined += (sender, args) => Update(); GameEvents.OnWorldChanged += (sender, args) => Update(); AllItems.Source = () => InventoryManager.AllItems.Where(i => !InvalidAnnIds.Contains(i.AnnId)); Stash.Source = () => AllItems.Where(i => i.InventorySlot == InventorySlot.SharedStash); }
private void RefreshAvailableItems() { foreach (var source in ComboBoxBindingSources) { var newAvailables = AllItems.Where( x => source.SelectedElement == x || ComboBoxBindingSources.All(y => y.SelectedElement != x)); source.AvailableElements = newAvailables; } }
public IEnumerable <OapAudit> GetAllByStatus(string status) { if (status.Equals("Open", StringComparison.InvariantCultureIgnoreCase)) { return(GetAll()); } return(AllItems.Where(c => c.Status.Equals(status, StringComparison.InvariantCultureIgnoreCase) )); }
public IEnumerable <Collectible> GetItemsForActionOnEntity(IActiveEntity actee, string action) { if (AllItems == null || AllItems.Count() <= 0) { return(null); } return(AllItems.Where(c => c != null && ActiveEntityManager.Instance.CanActOn(c, actee, action)).ToList()); }
public void NewButton_Pressed(object sender, RoutedEventArgs e) { if (!AllItems.Any() || AllItems.Count == ComboBoxBindingSources.Count) { return; } var remainingItems = AllItems.Where(x => ChosenItems.All(y => x.ID != y.ID)).ToList(); ComboBoxBindingSources.Add(new ComboBoxBindingSource(remainingItems.First(), remainingItems)); RefreshAvailableItems(); }
private void SaveModGUI_Loaded(object sender, RoutedEventArgs e) { ItemGrid.Columns.Remove(ItemGrid.Columns.First((col) => col.Header.ToString() == "HexValue")); // Remove the HexValue column ItemGrid.Columns.Remove(ItemGrid.Columns.First((col) => col.Header.ToString() == "Lockable")); // Remove the HexValue column List <Item> removeItems = AllItems.Where((item) => item.Name == String.Empty || item.Lockable == false).ToList(); foreach (Item item in removeItems) { AllItems.Remove(item); // <-- remove placeholders and non-lockable items } }
public async Task UpdateItemList(bool updateInventory) { if (!updateInventory && AllItems != null) { List <ItemData> items = AllItems.Where(x => x.InventoryItemData.Item != null).Select(x => x.InventoryItemData.Item).ToList(); Items = items; } else { await GetInventory(); } }
public async Task UpdatePokemonCandy(bool updateInventory) { if (!updateInventory && AllItems != null) { List <Candy> pokemonCandy = AllItems.Where(x => x.InventoryItemData.Candy != null).Select(x => x.InventoryItemData.Candy).ToList(); PokemonCandy = pokemonCandy; } else { await GetInventory(); } }
public async Task UpdatePokedex(bool updateInventory) { if (!updateInventory && AllItems != null) { List <PokedexEntry> pokedex = AllItems.Where(x => x.InventoryItemData.PokedexEntry != null).Select(x => x.InventoryItemData.PokedexEntry).ToList(); Pokedex = pokedex; } else { await GetInventory(); } }
private void RefreshAvailableItems() { if (ComboBoxBindingSources == null) { ComboBoxBindingSources = new ObservableCollection <ComboBoxBindingSource>(); } foreach (var source in ComboBoxBindingSources) { var newAvailables = AllItems.Where( x => source.SelectedElement == x || ComboBoxBindingSources.All(y => y.SelectedElement != x)); source.AvailableElements = newAvailables; } }
public async Task UpdatePokemon(bool updateInventory) { if (!updateInventory && AllItems != null) { List <PokemonData> pokemon = AllItems.Where(x => x.InventoryItemData.PokemonData != null && !x.InventoryItemData.PokemonData.IsEgg).Select(x => x.InventoryItemData.PokemonData).ToList(); List <PokemonData> eggs = AllItems.Where(x => x.InventoryItemData.PokemonData != null && x.InventoryItemData.PokemonData.IsEgg).Select(x => x.InventoryItemData.PokemonData).ToList(); Pokemon = pokemon; Eggs = eggs; } else { await GetInventory(); } }
private void UpdateMineOwners() { foreach (Mine mine in AllItems.Where(x => x is Mine).Cast <Mine>()) { mine.Owner = null; foreach (var item in PlayerList) { int FriendlyCount = this.AllUnits.Count(x => x.Owner.Up == item.Up && mine.EnemySide(item.Up).World.Contains((int)x.Location.World.X, (int)x.Location.World.Y)); int EnemyCount = this.AllUnits.Count(x => x.Owner.Up != item.Up && mine.MySide(item.Up).World.Contains((int)x.Location.World.X, (int)x.Location.World.Y)); if (FriendlyCount > 0 && EnemyCount == 0) { mine.Owner = item; } } } }
public async Task <bool> DetailsShoppingCartPost(ShoppingCart cart, Claim claim) { cart.Id = 0; cart.ApplicationUserId = claim.Value; var carts = await AllItems.Where(z => z.MenuItemId == cart.MenuItemId && z.ApplicationUserId == cart.ApplicationUserId).FirstOrDefaultAsync(); if (carts == null) { return(await AddItemAsync(cart)); } else { carts.Count = carts.Count + cart.Count; return(await UpdateItem(carts)); } }
public override void Draw() { { GraphicsProvider.Current.FillRectangle(Bounds.Screen, Color.GhostWhite); GraphicsProvider.Current.DrawBackground(GraphicsProvider.Current.Background, Bounds.ScreenWithScroll); string text = string.Empty; var DrawItems = AllItems.OrderBy(a => a.Location.World.Y); foreach (var item in DrawItems) { // if (Bounds.Screen.Contains((int)item.Location.Screen.X,(int)item.Location.Screen.Y)) { item.Draw(); } //text += string.Format("({0:000},{1:000})\n", item.Bounds.World.Left, item.Bounds.World.Top); } text = ToNetworkString(); GraphicsProvider.Current.DrawString(text, new Vector2(1200, 200)); } foreach (var item in UIElements) { item.Draw(); } foreach (var item in AllItems.Where(a => a is Factory)) { item.Draw(); } Location l1 = new Location() { Screen = new Vector2(LastMouseState.X, LastMouseState.Y) }; Location l2 = new Location() { Grid = l1.Grid }; Rectangle rect = new Rectangle((int)l2.Screen.X, (int)l2.Screen.Y, (int)Constants.TileSize, (int)Constants.TileSize); GraphicsProvider.Current.DrawButton(rect, ""); }
private Task <IEnumerable <EditFooTree> > OnTreeExpandQuary(EditFooTree foo) { return(Task.FromResult(AllItems.Where(f => f.ParentId == foo.Id))); }
public static List <ACDItem> OfType(params InventoryItemType[] types) { var typesHash = new HashSet <int>(types.Select(t => (int)t)); return(AllItems.Where(i => typesHash.Contains(i.ActorSNO)).ToList()); }
public static List <ACDItem> ByItemType(ItemType type) { return(AllItems.Where(i => i.ItemType == type).ToList()); }
public static List <ACDItem> OfType(InventoryItemType type) { return(AllItems.Where(i => i.ActorSNO == (int)type).ToList()); }
public static List <ACDItem> ByActorSNO(int ActorSNO) { return(AllItems.Where(i => i.ActorSNO == ActorSNO).ToList()); }
public IQueryable <RigOapChecklistQuestionAnswer> Filter(Expression <Func <RigOapChecklistQuestionAnswer, bool> > expression) { return(AllItems.Where(expression)); }
private async Task <IEnumerable <EditFooTree> > OnTreeExpandQuery(EditFooTree foo) { await Task.Delay(50); return(AllItems.Where(f => f.ParentId == foo.Id)); }
public static Item GetItemById(string id) { return(AllItems.Where(t => t.ID == id).FirstOrDefault() ?? new Item()); }
public static Item GetItemByLabel(string label) { return(AllItems.Where(t => t.Label == label).FirstOrDefault() ?? new Item()); }