Beispiel #1
0
        /// <summary>
        /// Sets the values on select.
        /// </summary>
        /// <exception cref="System.NotImplementedException"></exception>
        protected override void SetValuesOnSelect()
        {
            var itemIds = ItemIds.Select(int.Parse);
            var items   = new FinancialAccountService(new RockContext()).Queryable().Where(i => itemIds.Contains(i.Id));

            this.SetValues(items);
        }
        private IReadOnlyCollection <FlowComponent> getIdListRegionComponents()
        {
            var components = new List <FlowComponent>();

            var rs = new UpdateRegionSet();

            components.Add(
                new LineList(
                    new EwfButton(
                        new StandardButtonStyle("Add Item"),
                        behavior: new PostBackBehavior(
                            postBack: PostBack.CreateIntermediate(
                                rs.ToCollection(),
                                id: "idAdd",
                                modificationMethod: () =>
                                parametersModification.ItemIds = (parametersModification.ItemIds.Any() ? parametersModification.ItemIds.Min() - 1 : 0).ToCollection()
                                                                 .Concat(parametersModification.ItemIds)))).ToCollection()
                    .ToComponentListItem()
                    .ToLineListItemCollection()));

            var stack = new StackList(
                ItemIds.Select(getIdItem),
                setup: new ComponentListSetup(
                    itemInsertionUpdateRegions: new ItemInsertionUpdateRegion(rs.ToCollection(), () => parametersModification.ItemIds.First().ToString().ToCollection())
                    .ToCollection()));

            components.Add(new Section("Control List With ID Items", stack.ToCollection(), style: SectionStyle.Box));
            return(components);
        }
        public object Clone()
        {
            var result = MemberwiseClone() as DemoCartConfiguredGroup;

            result.ItemIds = ItemIds?.Select(x => x.ToString()).ToList();

            return(result);
        }
        private async Task LowerItemQuality()
        {
            if (_isDone)
            {
                await Coroutine.Yield();

                return;
            }

            List <BagSlot> bagSlots = IgnoreGear ? InventoryManager.FilledSlots.ToList() : InventoryManager.FilledSlots.Where(x => x.Item.StackSize == 999).ToList();

            List <uint> toLower;

            if (AllItems && ForceLower)
            {
                toLower = bagSlots.Where(x => x.IsHighQuality).Select(x => x.RawItemId).ToList();
            }
            else if (AllItems)
            {
                var HQ = bagSlots.Where(x => x.IsHighQuality).Select(x => x.RawItemId).OrderBy(x => x);
                var NQ = bagSlots.Where(x => !x.IsHighQuality).Select(x => x.RawItemId).OrderBy(x => x);
                toLower = NQ.Intersect(HQ).ToList();
            }
            else if (ForceLower)
            {
                toLower = ItemIds.Select(x => (uint)x).ToList();
            }
            else
            {
                var slotsWithId = bagSlots.Where(x => ItemIds.Contains((int)x.RawItemId)).ToList();
                var HQ          = slotsWithId.Where(x => x.IsHighQuality).Select(x => x.RawItemId).OrderBy(x => x);
                var NQ          = slotsWithId.Where(x => !x.IsHighQuality).Select(x => x.RawItemId).OrderBy(x => x);
                toLower = NQ.Intersect(HQ).ToList();
            }

            if (!toLower.Any())
            {
                _isDone = true;
                return;
            }

            await StopBusy(leaveDuty : false, dismount : false);

            foreach (var itemId in toLower)
            {
                await LowerQualityAndCombine((int)itemId);

                await Coroutine.Sleep(200);
            }

            _isDone = true;
        }