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

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

        private void buttonCallEmbeddedAssembly_Click(object sender, EventArgs e)
        {
            Assembly assembly = Assembly.LoadFrom(Application.StartupPath + @"\\ManagedDll1.dll");
            object obj = assembly.CreateInstance("ManagedDll1.Class1");
            obj.GetType().GetMethod("ShowMessage").Invoke(obj, new object[] { "Hi!" } );
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.boxedapp.com/?from_program=1");
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://www.boxedapp.com/order.html?from_program=1");
        }
    }
}