示例#1
0
        public Form1()
        {
            Year.SyncYear();
            Months.SyncMonth();
            InitializeComponent();
            this.PresentMonth.Text = Months.ToString();
            InitDateMatrix();
            try
            {
                allPlan = (PlanData)DeserializeFromXML(filepath);
            }
            catch
            {
            }
            if (allPlan == null)
            {
                allPlan = new PlanData();
            }
            this.CenterToScreen();
            new_Event = new New_Event(allPlan);
            LoadItemToDayView(Year.GetCurrentYear(), Months.iCurrent, DateTime.Now.Day);

            List <GroupPlanItem> groupsAlert = allPlan.ListGroupAlertForToday(DateTime.Now);

            for (int i = 0; i < groupsAlert.Count; i++)
            {
                alertForToday.AddRange(groupsAlert[i].ListAlertForToday(DateTime.Now));
            }

            timer          = new Timer();
            timer.Tick    += Notify;
            timer.Interval = (60 - DateTime.Now.Second) * 1000;
            timer.Start();
        }
示例#2
0
 private void Addbutton_Click(object sender, EventArgs e)
 {
     new_Event = new New_Event(allPlan);
     new_Event.ShowDialog();
 }