예제 #1
0
 public void Reset(MiMFa_Date fromDate = null)
 {
     if (FromDate != null || fromDate != null)
     {
         if (fromDate == null)
         {
             FromDate.CopyTo(fromDate);
         }
         MiMFa_Date md = new MiMFa_Date();
         fromDate.CopyTo(md);
         FromDate.CopyTo(_ToDate);
         bool ShowPriod = true;
         if (_PriodLength < 0)
         {
             ToDate.Month++;
             ToDate.Day = 1;
             ToDate.Day--;
         }
         else if (_PriodLength == 0)
         {
             ShowPriod = false;
         }
         else
         {
             ToDate.Day += (_PriodLength - 1);
         }
         md.Day   -= fromDate.DayOfWeekNum;
         PriodList = new List <MiMFa_Date>();
         for (int i = 1; i <= 42; i++)
         {
             DayCalendar dc = (DayCalendar)__tlp_Main.Controls.Find("dateTime_DayCalendar" + i, false)[0];
             MiMFa_Date  mm = new MiMFa_Date();
             md.CopyTo(mm);
             dc.Date = mm;
             if (MouseEvent)
             {
                 if (md.IsBetween(FromDate, ToDate) && ShowPriod)
                 {
                     PriodList.Add(md);
                     dc.Enabled   = true;
                     dc.BackColor = PriodBackColor;
                 }
                 else
                 {
                     dc.Enabled   = false;
                     dc.BackColor = AllDayBackColor;
                 }
             }
             if (DateAndTime.GetDatePAC().IsSame(md))
             {
                 dc.BackColor = TodayBackColor;
             }
             md.IncrementDay();
         }
     }
 }
예제 #2
0
 private void Start()
 {
     DateAndTime.TimeZone    = TimeZone;
     _FromDate.DateTimeStyle = DateAndTime;
     _FromDate     = DateAndTime.GetDatePAC();
     _FromDate.Day = 1;
     FromDate.CopyTo(_ShowOfDate);
     Saturday.Text  = DateAndTime.GetDayOfWeekName(0);
     Sunday.Text    = DateAndTime.GetDayOfWeekName(1);
     Monday.Text    = DateAndTime.GetDayOfWeekName(2);
     Tuesday.Text   = DateAndTime.GetDayOfWeekName(3);
     Wednesday.Text = DateAndTime.GetDayOfWeekName(4);
     Thursday.Text  = DateAndTime.GetDayOfWeekName(5);
     Friday.Text    = DateAndTime.GetDayOfWeekName(6);
 }