Esempio n. 1
0
 public MonthForm(Masterplan.Data.MonthInfo month)
 {
     this.InitializeComponent();
     Application.Idle        += new EventHandler(this.Application_Idle);
     this.fMonthInfo          = month.Copy();
     this.NameBox.Text        = this.fMonthInfo.Name;
     this.DaysBox.Value       = this.fMonthInfo.DayCount;
     this.LeapModBox.Value    = this.fMonthInfo.LeapModifier;
     this.LeapPeriodBox.Value = Math.Max(2, this.fMonthInfo.LeapPeriod);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a copy of the MonthInfo.
        /// </summary>
        /// <returns>Returns the copy.</returns>
        public MonthInfo Copy()
        {
            MonthInfo mi = new MonthInfo();

            mi.ID           = fID;
            mi.Name         = fName;
            mi.DayCount     = fDayCount;
            mi.LeapModifier = fModifier;
            mi.LeapPeriod   = fPeriod;

            return(mi);
        }
Esempio n. 3
0
        public MonthInfo Copy()
        {
            MonthInfo monthInfo = new MonthInfo()
            {
                ID           = this.fID,
                Name         = this.fName,
                DayCount     = this.fDayCount,
                LeapModifier = this.fModifier,
                LeapPeriod   = this.fPeriod
            };

            return(monthInfo);
        }
Esempio n. 4
0
        public override string ToString()
        {
            Calendar calendar = Session.Project.FindCalendar(this.fCalendarID);

            if (calendar == null)
            {
                return("");
            }
            MonthInfo monthInfo = calendar.FindMonth(this.fMonthID);

            if (monthInfo == null)
            {
                return("");
            }
            int num = this.fDayIndex + 1;

            object[] name = new object[] { monthInfo.Name, " ", num, ", ", this.fYear };
            return(string.Concat(name));
        }
Esempio n. 5
0
        /// <summary>
        /// Month N, Year
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            Calendar cal = Session.Project.FindCalendar(fCalendarID);

            if (cal == null)
            {
                return("");
            }

            MonthInfo month = cal.FindMonth(fMonthID);

            if (month == null)
            {
                return("");
            }

            int day = fDayIndex + 1;

            return(month.Name + " " + day + ", " + fYear);
        }
Esempio n. 6
0
        public MonthInfo FindMonth(Guid month_id)
        {
            MonthInfo monthInfo;

            List <MonthInfo> .Enumerator enumerator = this.fMonths.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    MonthInfo current = enumerator.Current;
                    if (current.ID != month_id)
                    {
                        continue;
                    }
                    monthInfo = current;
                    return(monthInfo);
                }
                return(null);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
        }