public override async Task <DialogResult> ShowModal() { if (AcceptedTypes.Count > 0) { // Gather all registered asset types that are assignable to the given accepted types var assetTypes = AssetRegistry.GetPublicTypes().Where(x => AcceptedTypes.Any(y => y.IsAssignableFrom(x))).ToList(); // Retrieve the filters that then match the collected asset types var activeFilters = AssetView.TypeFilters.Where(f => assetTypes.Any(t => string.Equals(t.FullName, f.Filter))); foreach (var filter in activeFilters) { filter.IsReadOnly = true; // prevent the user from removing or deactivating the filter AssetView.AddAssetFilter(filter); } } selectedAssets.Clear(); await base.ShowModal(); if (Result == Presentation.Services.DialogResult.Ok) { selectedAssets.AddRange(AssetView.SelectedAssets); } return(Result); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_AcceptedType = (AcceptedTypes)reader.ReadInt(); }
public async Task <IActionResult> IsAcssept(long?id, AcceptedTypes AccessTypeId, string Reason) { var product = await _context.Products.FindAsync(id); if (product == null) { return(NotFound()); } if (ModelState.IsValid) { try { product.IsAccepted = AccessTypeId; product.Reason = Reason; _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.Id)) { return(NotFound()); } else { throw; } } } ViewData["CorroborantId"] = new SelectList(_context.Corroborants, "Id", "Id", product.CorroborantId); ViewData["ProductTypeId"] = new SelectList(_context.ProductTypes, "Id", "Id", product.ProductTypeId); return(RedirectToAction(nameof(Index))); }
public static void SupplyCustomItems(List <Item> itemList, Mobile toSupply, AcceptedTypes bagContains, bool newbieAllItems, int clothHue, int gearHue, string teamName, bool stayEquipped, bool consumeItems) { List <Item> itemsToGive = new List <Item>(); for (int i = 0; i < itemList.Count; i++) { MakeCopy(itemList[i], ref itemsToGive); } if (bagContains == AcceptedTypes.Cloths) { MakeEventItems(itemsToGive.ToArray(), clothHue, teamName, false, stayEquipped, consumeItems); } else { MakeEventItems(itemsToGive.ToArray(), gearHue, teamName, false, false, consumeItems); } //Drop regular items in the backpack, equip all others if (bagContains != AcceptedTypes.Others) { for (int i = 0; i < itemsToGive.Count; ++i) { EquipItem(toSupply, itemsToGive[i]); } } else { for (int i = 0; i < itemsToGive.Count; ++i) { if (itemsToGive[i].Parent == null) //Only add the item to our pack if it is not in a container { toSupply.AddToBackpack(itemsToGive[i]); } } } }
public EventItemContainer(AcceptedTypes acceptedType) { m_AcceptedType = acceptedType; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_AcceptedType = (AcceptedTypes)reader.ReadInt(); }
public static void SupplyCustomItems(List<Item> itemList, Mobile toSupply, AcceptedTypes bagContains, bool newbieAllItems, int clothHue, int gearHue, string teamName, bool stayEquipped, bool consumeItems) { List<Item> itemsToGive = new List<Item>(); for (int i = 0; i < itemList.Count; i++) MakeCopy(itemList[i], ref itemsToGive); if ( bagContains == AcceptedTypes.Cloths) MakeEventItems(itemsToGive.ToArray(), clothHue, teamName, false, stayEquipped, consumeItems); else MakeEventItems(itemsToGive.ToArray(), gearHue, teamName, false, false, consumeItems); //Drop regular items in the backpack, equip all others if (bagContains != AcceptedTypes.Others) for (int i = 0; i < itemsToGive.Count; ++i) EquipItem(toSupply, itemsToGive[i]); else for (int i = 0; i < itemsToGive.Count; ++i) if ( itemsToGive[i].Parent == null) //Only add the item to our pack if it is not in a container toSupply.AddToBackpack(itemsToGive[i]); }
public static void SupplyCustomItems(List<Item> itemList, Mobile toSupply, AcceptedTypes bagContains, bool newbieAllItems) { SupplyCustomItems(itemList, toSupply, bagContains, newbieAllItems, 0, 0, string.Empty, false, false); }
public static void SupplyCustomItems(List <Item> itemList, Mobile toSupply, AcceptedTypes bagContains, bool newbieAllItems) { SupplyCustomItems(itemList, toSupply, bagContains, newbieAllItems, 0, 0, string.Empty, false, false); }