Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Reflection;

namespace EA_ReqPro
{
        /// <summary>
        /// Summary description for AboutForm.
        /// </summary>
        public class AboutForm : System.Windows.Forms.Form
        {
      private System.Windows.Forms.Label label1;
      private System.Windows.Forms.LinkLabel linkLabel1;
      private System.Windows.Forms.Label label_version;
                /// <summary>
                /// Required designer variable.
                /// </summary>
                private System.ComponentModel.Container components = null;

                public AboutForm()
                {
                        //
                        // Required for Windows Form Designer support
                        //
                        InitializeComponent();

         this.linkLabel1.Links[0].LinkData = "http://bms/docRegister/docDetail.asp?docnum=TECHGP-00027";

         Assembly asm = Assembly.GetExecutingAssembly();
         AssemblyName asmName = asm.GetName();

         this.label_version.Text = string.Format("Version {0}.{1}.{2}.{3}",
         asmName.Version.Major,
         asmName.Version.Minor,
         asmName.Version.Build,
         asmName.Version.Revision);

                }

                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                protected override void Dispose( bool disposing )
                {
                        if( disposing )
                        {
                                if(components != null)
                                {
                                        components.Dispose();
                                }
                        }
                        base.Dispose( disposing );
                }

                #region Windows Form Designer generated code
                /// <summary>
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
         this.label1 = new System.Windows.Forms.Label();
         this.linkLabel1 = new System.Windows.Forms.LinkLabel();
         this.label_version = new System.Windows.Forms.Label();
         this.SuspendLayout();
         // 
         // label1
         // 
         this.label1.Location = new System.Drawing.Point(24, 8);
         this.label1.Name = "label1";
         this.label1.Size = new System.Drawing.Size(320, 40);
         this.label1.TabIndex = 0;
         this.label1.Text = "ERG Enterprise Architect ReqPro Integration Addin.";
         // 
         // linkLabel1
         // 
         this.linkLabel1.Location = new System.Drawing.Point(16, 96);
         this.linkLabel1.Name = "linkLabel1";
         this.linkLabel1.Size = new System.Drawing.Size(328, 16);
         this.linkLabel1.TabIndex = 3;
         this.linkLabel1.TabStop = true;
         this.linkLabel1.Text = "see TECHGP-00027 EA_ReqPro User Manaual";
         this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
         // 
         // label_version
         // 
         this.label_version.Location = new System.Drawing.Point(24, 48);
         this.label_version.Name = "label_version";
         this.label_version.Size = new System.Drawing.Size(320, 23);
         this.label_version.TabIndex = 4;
         this.label_version.Text = "version unknown";
         // 
         // AboutForm
         // 
         this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
         this.ClientSize = new System.Drawing.Size(400, 144);
         this.Controls.Add(this.label_version);
         this.Controls.Add(this.linkLabel1);
         this.Controls.Add(this.label1);
         this.Name = "AboutForm";
         this.Text = "About";
         this.ResumeLayout(false);

      }
                #endregion

      private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
      {
         // Determine which link was clicked within the LinkLabel.
         this.linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true;

         // Display the appropriate link based on the value of the
         // LinkData property of the Link object.
         string target = e.Link.LinkData as string;

         // If the value looks like a URL, navigate to it.
         // Otherwise, display it in a message box.
         if(null != target && target.StartsWith("http"))
         {
            System.Diagnostics.Process.Start(target);
         }
         else
         {
            MessageBox.Show("Item clicked: " + target);
         }

      }




        }
}