public void getPreviousTest() { BMPLogic logic = new BMPLogic(400, 400); logic.startDrawing(new MouseEventArgs(MouseButtons.Left, 0, 100, 100, -1)); logic.draw(new MouseEventArgs(MouseButtons.Left, 0, 200, 200, -1)); logic.finishDrawing(new MouseEventArgs(MouseButtons.Left, 0, 200, 200, -1)); Assert.NotNull(logic.getPrevious()); }
/// <summary> /// Обработка сочетаний клавиш /// </summary> /// <param name="message">Сообщение</param> /// <param name="keys">Клавиши</param> /// <returns>Результат обработки</returns> protected override bool ProcessCmdKey(ref Message message, Keys keys) { switch (keys) { case Keys.Control | Keys.Z: { picture.Image = logic.getPrevious(); picture.Refresh(); Size = new Size(picture.Image.Width + 90, picture.Image.Height + 137); picture.Size = picture.Image.Size; return(true); } } return(base.ProcessCmdKey(ref message, keys)); }