예제 #1
0
        void Cmd_ShowNonActivitiesClick(object sender, EventArgs e)
        {
            var src = Model.NonActivities();

            if (src.Length == 0)
            {
                Info.Text = "Všechny aktivity jsou pravidelné.";
                return;
            }
            PanelDay.Controls.Clear();
            foreach (ActivityRecord ac in src)
            {
                var item = new Label();
                item.AutoSize         = true;
                item.Font             = new Font(font, fontSize);
                item.Tag              = ac.id;
                item.Text             = ActivityLine(ac);
                item.ContextMenuStrip = ContextMenuActivity;
                item.Click           += LabelActivityModifyClick;
                PanelDay.Controls.Add(item);
                PanelDay.SetFlowBreak(item, true);
            }
            Info.Text = "Tyto aktivity nemají nastaven žádný den zobrazování.";
        }
예제 #2
0
 void ShowDayLog(int dayIndex)
 {
     PanelDay.Controls.Clear();
     if (Model.events.ContainsKey(dayIndex))
     {
         foreach (EventRecord rec in Model.events[dayIndex])
         {
             var item = new Label();
             item.AutoSize         = true;
             item.Font             = new Font(font, fontSize);
             item.Tag              = rec.id;
             item.Text             = EventLine(rec);
             item.ContextMenuStrip = ContextMenuEvent;
             item.Click           += LabelEventModifyClick;
             PanelDay.Controls.Add(item);
             PanelDay.SetFlowBreak(item, true);
         }
     }
     if (activeDay != nullDay)
     {
         foreach (var kv in Model.activities)
         {
             var flowDay = new DateTime(year, month, dayIndex);
             var dow     = flowDay.DayOfWeek;
             if (dow == DayOfWeek.Monday && !kv.Value.Mo)
             {
                 continue;
             }
             if (dow == DayOfWeek.Tuesday && !kv.Value.Tu)
             {
                 continue;
             }
             if (dow == DayOfWeek.Wednesday && !kv.Value.We)
             {
                 continue;
             }
             if (dow == DayOfWeek.Thursday && !kv.Value.Th)
             {
                 continue;
             }
             if (dow == DayOfWeek.Friday && !kv.Value.Fr)
             {
                 continue;
             }
             if (dow == DayOfWeek.Saturday && !kv.Value.Sa)
             {
                 continue;
             }
             if (dow == DayOfWeek.Sunday && !kv.Value.Su)
             {
                 continue;
             }
             var item = new Label();
             item.AutoSize         = true;
             item.Font             = new Font(font, fontSize);
             item.Tag              = kv.Value.id;
             item.Text             = ActivityLine(kv.Value);
             item.ContextMenuStrip = ContextMenuActivity;
             item.Click           += LabelActivityModifyClick;
             PanelDay.Controls.Add(item);
             PanelDay.SetFlowBreak(item, true);
         }
     }
 }