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 ch6_3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Change_Click(object sender, EventArgs e)
        {
            RefOut rf = new RefOut();
            int x = Convert.ToInt16(textBox1.Text);
            int y = Convert.ToInt16(textBox2.Text);
            rf.Swap(ref x, ref y);
            label1.Text = "New x :";
            label2.Text = "New y : ";
            textBox1.Text = x.ToString();
            textBox2.Text = y.ToString();
        }

        private void Rand_Click(object sender, EventArgs e)
        {
            RefOut rf = new RefOut();
            int x;
            rf.Rand(out x);
            label3.Text = "Out parameter is : " + x.ToString();
        }
    }
}
