private void Calculate(IEnumerable<FunctionArgument> items, ref double nItems, ParsingContext context, ItemContext itemContext) { foreach (var item in items) { var cs = item.Value as ExcelDataProvider.IRangeInfo; if (cs != null) { foreach (var c in cs) { _CheckForAndHandleExcelError(c, context); if (ShouldIgnore(c, context) == false && ShouldCount(c.Value, ItemContext.InRange)) { nItems++; } } } else { var value = item.Value as IEnumerable<FunctionArgument>; if (value != null) { Calculate(value, ref nItems, context, ItemContext.InArray); } else { _CheckForAndHandleExcelError(item, context); if (ShouldIgnore(item) == false && ShouldCount(item.Value, itemContext)) { nItems++; } } } } }
public ItemsController(ItemContext phoneContext, PhonePropertiesContext hardwareContext) { _phoneContext = phoneContext; _hardwareContext = hardwareContext; }
/// <summary> /// Handles the footer deleted event. /// </summary> /// <param name="sender">Sender of the event.</param> /// <param name="e">Empty argument.</param> void FooterDeletedHandler(object sender, EventArgs e) { _itemContextList.Remove(_footerContext); _footerContext = null; }
public ItemController(ItemContext context) { _context = context; }
public VoidStorageItem(ulong id, uint entry, ObjectGuid creator, uint randomBonusListId, uint fixedScalingLevel, uint artifactKnowledgeLevel, ItemContext context, List <uint> bonuses) { ItemId = id; ItemEntry = entry; CreatorGuid = creator; RandomBonusListId = randomBonusListId; FixedScalingLevel = fixedScalingLevel; ArtifactKnowledgeLevel = artifactKnowledgeLevel; Context = context; foreach (var value in bonuses) { BonusListIDs.Add(value); } }
protected virtual Result <ItemUsedResult> DoUse(Character character, ItemContext useContext) { return(new ItemUsedResult(useContext.useAmount, true, 0f)); }
public static void Write(PageItem item, ItemContext itemContext) { ReportToRplOmWriter reportToRplOmWriter = new ReportToRplOmWriter(item, itemContext); reportToRplOmWriter.WriteImpl(); }
public CreateModel(ItemContext context) { _context = context; }
/// <summary> /// Default ctor /// </summary> public TurnTableItem(ITurnTable turnTable, bool editable, ItemContext context) : base(turnTable, context) { }
public ItemsController(ItemContext context) { _context = context; filteredItems = _context.Items.AsNoTracking().ToList(); }
/// <inheritdoc/> public ItemContext <CustomErrorPageItemViewModel> SaveCustomErrorPageItemInXml(ItemContext <CustomErrorPageItemViewModel> context, string customErrorPageItemId, string provider) { ServiceUtility.DisableCache(); return(this.SaveCustomErrorPageItemInternal(context, customErrorPageItemId, provider)); }
/// <summary> /// Saves the customErrorPageItem internal. /// </summary> /// <param name="context">The context.</param> /// <param name="customErrorPageItemId">The customErrorPageItem id.</param> /// <param name="provider">The provider.</param> /// <returns></returns> private ItemContext <CustomErrorPageItemViewModel> SaveCustomErrorPageItemInternal(ItemContext <CustomErrorPageItemViewModel> context, string customErrorPageItemId, string provider) { var manager = CustomErrorPagesManager.GetManager(provider); var id = new Guid(customErrorPageItemId); CustomErrorPageItem customErrorPageItem = null; if (id == Guid.Empty) { customErrorPageItem = manager.CreateCustomErrorPageItem(); } else { customErrorPageItem = manager.GetCustomErrorPageItem(id); } CustomErrorPageItemsViewModelTranslator.ToModel(context.Item, customErrorPageItem, manager); if (id != Guid.Empty) { manager.UpdateCustomErrorPageItem(customErrorPageItem); } manager.SaveChanges(); CustomErrorPageItemsViewModelTranslator.ToViewModel(customErrorPageItem, context.Item, manager); return(context); }
public DeleteModel(ItemContext context) { _context = context; }
public BookendsController(ItemContext context) : base(context) { }
/// <summary> /// Default ctor /// </summary> public PassiveJunctionItem(IPassiveJunction entity, IPassiveJunctionState state, ItemContext context) : base(entity, context) { }
public FrameController(ItemContext context) : base(context) { }
public ItemController(ItemContext context) { this._context = context; }
public ItemRepository(ItemContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public ItemRepository(ItemContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public virtual Result <bool> CanUse(Character character, ItemContext useContext) { return(true); }
public OrdersController(ItemContext context) { _context = context; }
public BookendsController(ItemContext context) : base(context) { }
public ItemRepository(IOptions<DatabaseSettings> settings, IAddressRepository addressRepository) { _database = new ItemContext(settings); _addressRepository = addressRepository; }
public ItemController(ItemContext repositorio) { _repositorio = repositorio; }
public void Enter(Session session, DistrictEnterRequest request) { if (!_relayClient.Session.Validate(new() { Account = request.Account, Key = request.SessionKey }).Result) { NetworkUtils.DropSession(); } { AccountModel model = GetAccountModel(request.Account); session.Account = new(model); } { CharacterModel model = GetCharacterModel(request.Character, request.Account); session.Character = new(model); session.Profile = new(model.Profile); session.Stats = new(); session.SpecialOptions = new(); session.Gestures = model.Gestures; using ItemContext context = _itemFactory.CreateDbContext(); session.Storages = new(model, _tables, context); } if (!_dimensions.Join(session)) { NetworkUtils.DropSession(); } session.SendAsync(new ServiceCurrentDataResponse()); session.SendAsync(new WorldVersionResponse() { Id = 0, Main = 1, Sub = 837, Data = 16888 }); if (_tables.BattlePass.Count > 0) { PassInfoTableEntity entity = _tables.BattlePass.Values.First(); session.SendAsync(new BattlePassLoadResponse() { Id = entity.Id, HavePoint = 2000, NextReward = 3, StartDate = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), EndDate = DateTimeOffset.UtcNow.AddMonths(1).ToUnixTimeSeconds(), IsPremium = 1 }); } session.SendAsync(new DayEventBoosterResponse() { Values = _dayEventBoosters.Select(s => new DayEventBoosterResponse.Entity() { Id = s.Id, Maze = s.Maze.Id }).ToArray() }); // CharacterSuperArmorGage // LOGLV 2 : 454.747 :: eSUB_CMD_BOOSTER_ADD 2 session.SendAsync(new DistrictEnterResponse() { Place = new() { Location = _instance.Location.Id, Position = session.Character.Place.Position, Rotation = session.Character.Place.Rotation, } });
/// <summary> /// Default ctor /// </summary> public ModuleRunItem(IRailwayState railwayState, IModuleRef moduleRef, IModule module, bool contentsEditable, ItemContext context) : base(moduleRef, module, contentsEditable, context) { this.contentsEditable = contentsEditable; // Add all items AddPositionedItems(railwayState, module, PositionedEntities); }
//[WebInvoke(Method = "PUT", UriTemplate = "/parent/{parentId}/{valueId}/?provider={provider}")] public ItemContext <ProductAttributeValue> SaveProductAttributeValueWithParent(Guid parentId, Guid valueId, ItemContext <ProductAttributeValue> value, string provider) { var request = new RestRequest(this.ServiceUrl + "/parent/{parentId}/{valueId}/?provider={provider}", Method.PUT); request.AddUrlSegment("parentId", parentId.ToString()); request.AddUrlSegment("valueId", valueId.ToString()); request.AddUrlSegment("provider", provider); request.AddParameter("application/json", SerializeObject(value), ParameterType.RequestBody); return(ExecuteRequestFor <ItemContext <ProductAttributeValue> >(request)); }
// Calls processor of corresponding LootTemplate (which handles everything including references) public bool FillLoot(uint lootId, LootStore store, Player lootOwner, bool personal, bool noEmptyError = false, LootModes lootMode = LootModes.Default, ItemContext context = 0) { // Must be provided if (lootOwner == null) { return(false); } LootTemplate tab = store.GetLootFor(lootId); if (tab == null) { if (!noEmptyError) { Log.outError(LogFilter.Sql, "Table '{0}' loot id #{1} used but it doesn't have records.", store.GetName(), lootId); } return(false); } _itemContext = context; tab.Process(this, store.IsRatesAllowed(), (byte)lootMode); // Processing is done there, callback via Loot.AddItem() // Setting access rights for group loot case Group group = lootOwner.GetGroup(); if (!personal && group != null) { roundRobinPlayer = lootOwner.GetGUID(); for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter { if (player.IsInMap(lootOwner)) { FillNotNormalLootFor(player, player.IsAtGroupRewardDistance(lootOwner)); } } } for (byte i = 0; i < items.Count; ++i) { ItemTemplate proto = Global.ObjectMgr.GetItemTemplate(items[i].itemid); if (proto != null) { if (proto.GetQuality() < group.GetLootThreshold()) { items[i].is_underthreshold = true; } } } } // ... for personal loot else { FillNotNormalLootFor(lootOwner, true); } return(true); }
public MetadataController(ItemContext context) : base(context) { }
protected ReportToRplWriterBase(PageItem pageItem, ItemContext itemContext) { this.m_pageItem = pageItem; this.m_itemContext = itemContext; }
public IEnumerable<Item> Get() { var allItems = new ItemContext().GetAll(); return allItems; }
private ReportToRplStreamWriter(PageItem item, ItemContext itemContext) : base(item, itemContext) { this.m_spbifWriter = base.RplWriter.BinaryWriter; }
public void SaveBlogsImportConfig(ItemContext<BlogsImportBasicSettingsModel> settings, string key) { ServiceUtility.RequestAuthentication(); var manager = ConfigManager.GetManager(); manager.SaveSection(settings.Item.BlogsImportConfig); }
private ReportToRplOmWriter(PageItem item, ItemContext itemContext) : base(item, itemContext) { }
private bool ShouldCount(object value, ItemContext context) { switch (context) { case ItemContext.SingleArg: return IsNumeric(value) || IsNumericString(value); case ItemContext.InRange: return IsNumeric(value); case ItemContext.InArray: return IsNumeric(value) || IsNumericString(value); default: throw new ArgumentException("Unknown ItemContext:" + context.ToString(CultureInfo.InvariantCulture)); } }