Exemplo n.º 1
0
        public SpanOfYears YearsIntervalForPeriod(MonthPeriod period)
        {
            SpanOfYears[] validSpan = Milestones.Where((x) => SeqOfYears.SelectForPeriod(x, period)).ToArray();
            SpanOfYears   firstSpan = validSpan.FirstOrDefault();

            return(firstSpan == null?SpanOfYears.Empty() : firstSpan);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            MonthPeriod other = obj as MonthPeriod;

            return(this.isEqualToPeriod(other));
        }
Exemplo n.º 3
0
 private static bool SelectForPeriod(SpanOfYears span, MonthPeriod period)
 {
     return(period.Year() >= span.YearFrom && period.Year() <= span.YearUpto);
 }
 public static SpanOfMonths CreateFromYear(UInt16 year)
 {
     return(new SpanOfMonths(MonthPeriod.BeginYear(year), MonthPeriod.EndYear(year)));
 }
 public SpanOfMonths(MonthPeriod from, MonthPeriod upto)
 {
     this.PeriodFrom = (MonthPeriod)from.Clone();
     this.PeriodUpto = (MonthPeriod)upto.Clone();
 }
 public SpanOfMonths()
 {
     this.PeriodFrom = MonthPeriod.Empty();
     this.PeriodUpto = MonthPeriod.Empty();
 }
 public static SpanOfMonths CreateFromMonth(MonthPeriod period)
 {
     return(new SpanOfMonths(period, period));
 }
Exemplo n.º 8
0
        public virtual object Clone()
        {
            MonthPeriod otherPeriod = (MonthPeriod)this.MemberwiseClone();

            return(otherPeriod);
        }
Exemplo n.º 9
0
 public bool isEqualToPeriod(MonthPeriod other)
 {
     return(this.Code == other.Code);
 }
Exemplo n.º 10
0
        public int CompareTo(object obj)
        {
            MonthPeriod other = obj as MonthPeriod;

            return(this.Code.CompareTo(other.Code));
        }