コード例 #1
0
 /// <summary>
 /// Method updates the <see cref="GroupItem"/> property with regard to the
 /// gap between the current system time and the time stored in
 /// <see cref="LastUpdate"/> property.
 /// </summary>
 public void UpdateGroup()
 {
     if (this.IsPinned > 0)
     {
         GroupItem.SetGroup(GroupType.IsPinned);
     }
     else
     {
         if (this.LastUpdate >= GroupTimeSpanModel.TodayMinTime)
         {
             GroupItem.SetGroup(GroupType.Today);
         }
         else
         {
             if (this.LastUpdate >= GroupTimeSpanModel.YesterdayMinTime)
             {
                 GroupItem.SetGroup(GroupType.Yesterday);
             }
             else
             {
                 if (this.LastUpdate >= GroupTimeSpanModel.ThisWeekMinTime)
                 {
                     GroupItem.SetGroup(GroupType.ThisWeek);
                 }
                 else
                 {
                     if (this.LastUpdate >= GroupTimeSpanModel.LastWeekMinTime)
                     {
                         GroupItem.SetGroup(GroupType.LastWeek);
                     }
                     else
                     {
                         if (this.LastUpdate >= GroupTimeSpanModel.ThisMonthMinTime)
                         {
                             GroupItem.SetGroup(GroupType.ThisMonth);
                         }
                         else
                         {
                             if (this.LastUpdate >= GroupTimeSpanModel.LastMonthMinTime)
                             {
                                 GroupItem.SetGroup(GroupType.LastMonth);
                             }
                             else
                             {
                                 GroupItem.SetGroup(GroupType.Older);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 public void SetGroups(List <Group> groups)
 {
     this.groups = groups;
     foreach (Group g in groups)
     {
         GroupItem item = new GroupItem();
         item.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
         item.SetGroup(g);
         item.Clicked += item_Clicked;
         listPanelItems.Controls.Add(item);
     }
 }