///<summary>Construct a new FeeCache with the provided _queueClinicNums size limit. If a clinic other than HQ is currently selected, add that ///clinic to the queue. When doInitialize is set to true load in all of the HQ fees and the fees for the current clinic if there is one.</summary> public FeeCache(int numClinics = 5, bool doInitialize = true) { _queueClinicNums = new FeeCacheQueue(numClinics); _queueClinicNums.CurClinicNum = Clinics.ClinicNum; _dict = new FeeCacheDictionary(); if (doInitialize) { Initialize(); } }
///<summary>Return a copy of the queue.</summary> public FeeCacheQueue Copy() { FeeCacheQueue retVal = new FeeCacheQueue(this.Limit); retVal.CurClinicNum = this.CurClinicNum; foreach (long clinicNum in this) { retVal.Enqueue(clinicNum); } return(retVal); }
///<summary>Fill a new FeeCache with the provided list of fees. The size limit of _queueClinicNums will equal the number of distinct clinic nums ///represented in the list of fees.</summary> public FeeCache(List <Fee> listFees) { _queueClinicNums = new FeeCacheQueue(listFees.Select(x => x.ClinicNum).Distinct().Count()); Initialize(); Add(listFees); }