コード例 #1
0
ファイル: frmTrash.cs プロジェクト: elviswinston/SimpleNote
        private void btnRestoreTrash_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < flpTrash.Controls.Count; i++)
            {
                if (flpTrash.Controls[i].BackColor == Color.LightGray)
                {
                    TrashController.RefreshTrash();
                    Trash trash = TrashController.GetTrash(i);
                    Note  note  = new Note();

                    note.ID          = NoteController.GetListNote().Count;
                    note.description = trash.description;
                    note.dateCreated = trash.dateCreated;
                    note.tags        = trash.tags;
                    note.isPinned    = trash.isPinned;

                    TrashController.DeleteForever(trash);
                    TrashController.RefreshTrash();
                    NoteController.AddNote(note);


                    flpTrash.Controls.Remove(flpTrash.Controls[i]);
                    this.richTextBoxTrashDescription.Text = "";
                }
            }
        }
コード例 #2
0
ファイル: frmTrash.cs プロジェクト: elviswinston/SimpleNote
 private void btnDeleteTrash_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < this.flpTrash.Controls.Count; i++)
     {
         if (this.flpTrash.Controls[i].BackColor == Color.LightGray)
         {
             TrashController.RefreshTrash();
             Trash trash = TrashController.GetTrash(i);
             TrashController.DeleteForever(trash);
             flpTrash.Controls.Remove(flpTrash.Controls[i]);
         }
     }
     this.richTextBoxTrashDescription.Text = "";
 }