//
// Copyright (c) 2016, MindFusion LLC - Bulgaria.
//

using System;
using System.Windows.Forms;

namespace MindFusion.Spreadsheet.WinForms.Samples.CS.Demo
{
	public partial class AboutForm : Form
	{
		public AboutForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			// Obtain the version from the assembly
			System.Reflection.Assembly assembly =
				System.Reflection.Assembly.GetExecutingAssembly();
			var references = assembly.GetReferencedAssemblies();

			Version version = null;
			foreach (System.Reflection.AssemblyName a in references)
			{
				if (a.Name == "MindFusion.Spreadsheet.WinForms")
				{
					version = a.Version;
					break;
				}
			}

			if (version != null)
				_lblVersion.Text = "Version " + version.ToString();

			_lblCopyright.Text += (DateTime.Now.Year == 2013 ? " 2013, MindFusion LLC." : String.Format(" 2013-{0}, MindFusion LLC.", DateTime.Today.Year));
		}

		private void _linkMain_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			System.Diagnostics.Process.Start(@"http://mindfusion.eu/");
		}
	}
}
