Beispiel #1
0
        public Affair DeepCopy()
        {
            Affair clone = (Affair)this.MemberwiseClone();

            clone.IdInfo = new IdInfo(IdInfo.IdNumber);
            clone.task   = String.Copy(task);
            return(clone);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Task.Text = "";
            _params.Controls.Add(Task);
            _params.Controls.Add(Date);
            _params.ShowDialog(this);

            Affair t = new Affair();

            CreateTask(t);
        }
Beispiel #3
0
        public void CreateTask(Affair t)
        {
            t.task   = my_task;
            t.done   = false;
            t.date   = date_task;
            t.IdInfo = new IdInfo(1);

            MyTask.Text = $"{t.task}  {t.date}";
            tasks.Add(MyTask, t);
            this.Controls.Add(MyTask);
            this.Controls.Add(Done);
            this.Controls.Add(Date);
            ChangeStatus();
        }
Beispiel #4
0
        private void Copy(object sender, EventArgs e)
        {
            Label  cb    = (sender as Label);
            Affair t_new = tasks[cb].DeepCopy();

            Task.Text  = t_new.task;
            Date.Value = t_new.date;

            _params.Controls.Add(Task);
            _params.Controls.Add(Date);
            _params.ShowDialog(this);

            CreateTask(t_new);
        }