// ALL RIGHTS RESERVED:
// ====================
// The contents of this file, and associated files in this directory, are 
// Copyright (C) SPT , all rights reserved, 2009.
// All software Source Code, Images, Database-Design and code, Graphics Design 
// and source files, and related content (collectively referred to as SOURCE) are 
// Copyright (c) SPT, 2009, All Rights Reserved.
// http://SerialPortTool.com

// PTZ Controller is a Registered Trademark of SerialPortTool.com.



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

        private void AboutBox_Load(object sender, EventArgs e)
        {
            string name = Application.ProductName;

            this.Text = String.Format("About {0}", "PTZ Controller");
            LinkLabel1.Text = "http://www.serialporttool.com";
            lbVersion.Text = GetBuildVersion();
            lbBuild.Text = GetRevision();
        }

        private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LinkLabel1.LinkVisited = true;
            System.Diagnostics.Process.Start("IExplore.exe", "http://www.serialporttool.com");
        }


        /// <summary>
        /// this function will get build No from assembly version
        /// </summary>
        /// <returns></returns>
        private string GetBuildVersion()
        {
            Assembly app = Assembly.GetExecutingAssembly();
            Version v = app.GetName().Version;
            string version = string.Format("v {0}.{1}", v.Major, v.Minor);
            return version;

        }

        /// <summary>
        /// this function will get build No from assembly version
        /// </summary>
        /// <returns></returns>
        private string GetRevision()
        {
            Assembly app = Assembly.GetExecutingAssembly();
            Version v = app.GetName().Version;
            string version = string.Format("Build {0}", v.Revision);
            return version;

        }


    }
}