Esempio n. 1
0
        public void FillInYears(BasicPlayListData currentObj, ref CustomBasicList <ICondition> tempList, ref bool hadOne,
                                Action <CustomBasicList <ICondition> >?action = null) //i think needs to be here so its flexible of when its called.
        {
            if (currentObj.EarliestYear > 0)
            {
                if (currentObj.EarliestYear > currentObj.LatestYear && currentObj.LatestYear > 0)
                {
                    throw new BasicBlankException("The latest year must be greater or equal to the earliest year");
                }

                hadOne = true;
                if (currentObj.LatestYear > 0)
                {
                    tempList.AppendRangeCondition(nameof(IBaseSong.YearSong), currentObj.EarliestYear, currentObj.LatestYear);
                }
                else
                {
                    tempList.AppendCondition(nameof(IBaseSong.YearSong), cs.Equals, currentObj.EarliestYear);
                }

                if (action != null)
                {
                    action.Invoke(tempList);
                }
            }
        }