using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DesiredContractLibrary;
using System.Reflection;


namespace WindowsClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var asm = Assembly.LoadFile(@"C:\Users\vitor.rubio\Dropbox\projetos\Exemplos\C#\WebDependencyLab_4th_example_reflection\DesiredClassLibrary\bin\Debug\DesiredClassLibrary.dll");
            var type = asm.GetType("DesiredClassLibrary.DesiredClass");
            var client = Activator.CreateInstance(type) as DesiredContract;
            if (client == null) throw new Exception("broke");

            client.Name = "vitor";
            MessageBox.Show(client.GetHello());
        }
    }
}
