using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EX1
{
    public partial class Form1 : Form
    {
        string s1="";
        public Form1()
        {
            InitializeComponent();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            txtDest.Text = "";
            txtSource.Text = "";
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (txtSource.SelectedText == "")
                MessageBox.Show("لطفا متنی را انتخاب کنید", "هشدار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            else
            s1 = txtSource.SelectedText;
        }

        private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (s1==string.Empty)
                MessageBox.Show("هیچ متنی از منبع ارسال نشده است", "هشدار", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);  
            else
            txtDest.Text = s1;
        }

        private void backColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
            txtSource.BackColor = colorDialog1.Color;
            txtDest.BackColor = colorDialog1.Color;
        }

        private void foreColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            colorDialog1.ShowDialog();
            txtSource.ForeColor = colorDialog1.Color;
            txtDest.ForeColor = colorDialog1.Color;
        }

        private void فرستادنبهمقصدToolStripMenuItem_Click(object sender, EventArgs e)
        {
            copyToolStripMenuItem.PerformClick();
        }

        private void گرفتنازمنبعToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pasteToolStripMenuItem.PerformClick();
        }
    }
}
