public Bucket CreateBucket(BucketMode bucketMode, string name, DateTime date, bool isBucketMode)
        {
            if (!isBucketMode)
                return new Bucket() {Name = name, Date = date};

            switch (bucketMode)
            {
                case BucketMode.BiWeekly:
                    return new BiWeeklyBucket() { Name = name, Date = date };                    
                case BucketMode.WeeklyInMonth:
                    return new WeeklyBucket(){Name = name, Date = date};                    
                case BucketMode.QuarterEnd:                    
                case BucketMode.PrevMonthQuarterEnd:                    
                case BucketMode.Auction10YUS:
                    return new QuarterEndBucket() { Name = name, Date = date };  
                default:
                    throw new ArgumentOutOfRangeException("bucketMode", bucketMode, null);
            }
        }
 public void SetupYearlyBuckets(BucketMode bucketMode, int window=0)
 {
     switch (bucketMode)
     {
         case BucketMode.BiWeekly:
             SetupHalfMonthBucketForYears();
             break;
         case BucketMode.WeeklyInMonth:
             SetupWeeklyInMonthBucketsForYears();
             break;
         case BucketMode.QuarterEnd:
             SetupQuarterEndBucketsForYears(window);
             break;
         case BucketMode.PrevMonthQuarterEnd:
             SetupQuarterEndOffsetMinusOneMonthBucketsForYears(window);                    
             break;
         case BucketMode.Auction10YUS:
             SetupUS10YrAuctionBucketForYears(window);
             break;
         default:
             throw new ArgumentOutOfRangeException("bucketMode", bucketMode, null);
     }
 }