예제 #1
0
        // ============= добавить событие клик
        private void toolStripMenuItem10_Click(object sender, EventArgs e)
        {
            // родитлеь
            //ContextMenuStrip cm = sender as ContextMenuStrip;
            //Type tp = cm.Parent.GetType();
            if (CotextMenuControl != null)
            {
                Type tp = CotextMenuControl.GetType();
                if (tp == typeof(Label))
                {
                    //Label lbl = cm.Parent as Label;
                    Label lbl = CotextMenuControl as Label;

                    // определить чего нажали
                    int ind = FindIndexCurentLabel(lbl);
                    if (ind >= 0)
                    {
                        // открыть форму добавления/изменения события
                        //EditAddEvent fr = new EditAddEvent(WorkDir, vers, FirstDay.AddDays(ind));
                        //EditAddEvent fr = new EditAddEvent(WorkDir, vers, FirstDay.AddDays(ind), "", true);
                        EditAddEvent fr = new EditAddEvent(WorkDir + "\\" + EventListFile, vers, FirstDay.AddDays(ind), this);
                        fr.ShowDialog();
                        RefreshMonth();
                    }
                }
                CotextMenuControl = null;
            }
            //EditAddEvent fr = new EditAddEvent(
        }
예제 #2
0
        // добавить.клик
        private void btnAdd_Click(object sender, EventArgs e)
        {
            EditAddEvent fr = new EditAddEvent(FileName, vers, Date, MnFrm);

            if (fr.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // обновить форму
                RefreshForm();

                // переопределить таймер
                RestartTimer();
            }
        }
예제 #3
0
        // изменить.клик
        private void btnEdit_Click(object sender, EventArgs e)
        {
            List <int> LI = ListOfChekedEvents();

            if (LI.Count > 0)
            {
                // изменяем только одну запись
                int          indx    = OriginalIndex[LI[0]];
                EditAddEvent newForm = new EditAddEvent(FileName, vers, indx, MnFrm);
                if (newForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    RefreshForm();
                }
            }
        }