public AddBillPaymentView()
 {
     InitializeComponent();
     titled("Add Bill Payment").icon(ApplicationIcons.AddBillPayment);
     ux_submit_button.Click += (sender, e) => submit_clicked(e);
     companies_list = ux_company_names.create_for<CompanyDTO>();
 }
        protected override void LoadBeatmap(WorkingBeatmap beatmap)
        {
            base.LoadBeatmap(beatmap);

            controlPointGroups = beatmap.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
            controlPointGroups.BindCollectionChanged((sender, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Reset:
                    Clear();
                    break;

                case NotifyCollectionChangedAction.Add:
                    foreach (var group in args.NewItems.OfType <ControlPointGroup>())
                    {
                        Add(new TimelineControlPointGroup(group));
                    }
                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (var group in args.OldItems.OfType <ControlPointGroup>())
                    {
                        var matching = Children.SingleOrDefault(gv => gv.Group == group);

                        matching?.Expire();
                    }

                    break;
                }
            }, true);
        }
Exemple #3
0
        private void recreateEvents(IBindableList <ProjectEvent> events)
        {
            localEvents.UnbindAll();

            eventList.Clear();
            addItems(events);

            localEvents.BindTo(events);

            localEvents.CollectionChanged += (_, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    addItems(args.NewItems.Cast <ProjectEvent>());

                    break;

                case NotifyCollectionChangedAction.Remove:
                    removeItems(args.OldItems.Cast <ProjectEvent>());

                    break;
                }
            };
        }
    public static bool IsImplicitBinding <T>(this IBindableList <T> list)
    {
        if (list is null)
        {
            throw new ArgumentNullException(nameof(list));
        }

        return(list.BindingBehavior == BindingBehavior.Implicit);
    }
Exemple #5
0
        public AddNewIncomeView()
        {
            InitializeComponent();
            titled("Add Income")
                .icon(ApplicationIcons.AddNewIncome);
            ux_submit_button.Click += (sender, e) => submit_button(e);

            companies_list = ux_companys.create_for<CompanyDTO>();
        }
            protected override void LoadComplete()
            {
                base.LoadComplete();

                selectedGroup.BindValueChanged(selected => { deleteButton.Enabled.Value = selected.NewValue != null; }, true);

                controlGroups = Beatmap.Value.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
                controlGroups.CollectionChanged += (sender, args) => createContent();
                createContent();
            }
Exemple #7
0
 public void UnBind()
 {
     _generateCell = null;
     _scrollRect   = null;
     _list         = null;
     _cell         = null;
     _existence.Clear();
     _buffer.Clear();
     _existence  = null;
     _scrollRect = null;
 }
Exemple #8
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            inputManager = GetContainingInputManager();

            controlPoints               = slider.Path.ControlPoints.GetBoundCopy();
            controlPoints.ItemsAdded   += addControlPoints;
            controlPoints.ItemsRemoved += removeControlPoints;

            addControlPoints(controlPoints);
        }
Exemple #9
0
            public ControlGroupAttributes(ControlPointGroup group)
            {
                InternalChild = fill = new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Horizontal,
                    Padding          = new MarginPadding(10),
                    Spacing          = new Vector2(2)
                };

                controlPoints = group.ControlPoints.GetBoundCopy();
            }
Exemple #10
0
        protected void Bind <TCellData, TListContext>(ScrollRect scrollRect, IBindableList <TCellData, TListContext> list, GameObject cell, Model model)
        {
            if (scrollRect is null)
            {
                throw new ArgumentNullException(nameof(scrollRect));
            }

            if (list is null)
            {
                throw new ArgumentNullException(nameof(list));
            }

            if (cell is null)
            {
                throw new ArgumentNullException(nameof(cell));
            }
            _bindingHelpers.Add(new BindingHelperForList <TCellData, TListContext>(scrollRect, list, cell, model, GenerateCell));
        }
Exemple #11
0
        public BindingHelperForList(ScrollRect scrollRect, IBindableList <T> list, GameObject cell, Model model, GenerateGameObject generateCell)
        {
            _scrollRect   = scrollRect;
            _list         = list;
            _cell         = cell;
            _model        = model;
            _generateCell = generateCell;

            if (_model == Model.OneTime)
            {
                OnListChanged(_list);
            }
            else if (_model == Model.OneWay)
            {
                OnListChanged(_list);
                _list.OnListChanged += OnListChanged;
            }
        }
Exemple #12
0
 void OnListChanged(IBindableList <T> list)
 {
     while (_existence.Count < list.Count)
     {
         if (_buffer.Count > 0)
         {
             GameObject temp = _buffer[0];
             _buffer.RemoveAt(0);
             temp.SetActive(true);
             _existence.Add(temp);
         }
         else
         {
             GameObject temp = _generateCell?.Invoke(_cell, _scrollRect.content);
             _existence.Add(temp);
         }
     }
     while (_existence.Count > list.Count)
     {
         GameObject temp = _existence[0];
         _existence.RemoveAt(0);
         temp.SetActive(false);
         _buffer.Add(temp);
     }
     for (int i = 0; i < _existence.Count; i++)
     {
         _existence[i].transform.SetAsLastSibling();
         IBindableListCell <T> temp = _existence[i].GetComponent <IBindableListCell <T> >();
         if (temp == null)
         {
             throw new AquaFrameworkException("The cell doesn't implement IBindableListCell<T>");
         }
         temp.Index = i;
         temp.Value = list[i];
         temp.SetContext(list[i]);
     }
 }
Exemple #13
0
 private void load()
 {
     samplePoints = controlPoints.SamplePoints.GetBoundCopy();
     samplePoints.BindCollectionChanged((_, __) => recreateMappings(), true);
 }
        public void SetUp() => Schedule(() =>
        {
            replay = new Replay();

            users = streamingClient.PlayingUsers.GetBoundCopy();
            users.BindCollectionChanged((obj, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (int user in args.NewItems)
                    {
                        if (user == api.LocalUser.Value.Id)
                        {
                            streamingClient.WatchUser(user);
                        }
                    }

                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (int user in args.OldItems)
                    {
                        if (user == api.LocalUser.Value.Id)
                        {
                            streamingClient.StopWatchingUser(user);
                        }
                    }

                    break;
                }
            }, true);

            streamingClient.OnNewFrames += onNewFrames;

            Add(new GridContainer
            {
                RelativeSizeAxes = Axes.Both,
                Content          = new[]
                {
                    new Drawable[]
                    {
                        recordingManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
                        {
                            Recorder = recorder = new TestReplayRecorder
                            {
                                ScreenSpaceToGamefield = pos => recordingManager.ToLocalSpace(pos),
                            },
                            Child = new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        Colour           = Color4.Brown,
                                        RelativeSizeAxes = Axes.Both,
                                    },
                                    new OsuSpriteText
                                    {
                                        Text   = "Sending",
                                        Scale  = new Vector2(3),
                                        Anchor = Anchor.Centre,
                                        Origin = Anchor.Centre,
                                    },
                                    new TestInputConsumer()
                                }
                            },
                        }
                    },
                    new Drawable[]
                    {
                        playbackManager = new TestRulesetInputManager(new TestSceneModSettings.TestRulesetInfo(), 0, SimultaneousBindingMode.Unique)
                        {
                            Clock = new FramedClock(manualClock),
                            ReplayInputHandler = replayHandler = new TestFramedReplayInputHandler(replay)
                            {
                                GamefieldToScreenSpace = pos => playbackManager.ToScreenSpace(pos),
                            },
                            Child = new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        Colour           = Color4.DarkBlue,
                                        RelativeSizeAxes = Axes.Both,
                                    },
                                    new OsuSpriteText
                                    {
                                        Text   = "Receiving",
                                        Scale  = new Vector2(3),
                                        Anchor = Anchor.Centre,
                                        Origin = Anchor.Centre,
                                    },
                                    new TestInputConsumer()
                                }
                            },
                        }
                    }
                }
            });

            Add(latencyDisplay = new OsuSpriteText());
        });