Click here to Skip to main content
15,881,803 members
Articles / Multimedia / GDI+

100% Reflective Class Diagram Creation Tool

Rate me:
Please Sign up or sign in to vote.
4.98/5 (498 votes)
14 Jun 2011CPOL28 min read 1.8M   39.6K   1.2K  
100% Reflective Class Diagram Creation Tool
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace AutoDiagramer
{
    #region frmAbout CLASS
    /// <summary>
    /// An about form, with email links to the author
    /// </summary>
    public partial class frmAbout : Form
    {
        #region Constructor 
        /// <summary>
        /// Creates a new frmAbout object
        /// </summary>
        public frmAbout()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw |
                     ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
        }
        #endregion
        #region Private Methods
        /// <summary>
        /// Creates the form text
        /// </summary>
        private void setUpFormText()
        {
            //setup text
            this.Text = "AutoDiagrammer";
            lblTitle.Text = "AutoDiagrammer Version : v" + Program._appVersion;
            lblOther.Text = "AutoDiagrammer is free software; you can redistribute it and/or modify it under the terms\r\n";
            lblOther.Text += "of the GNU General Public License as published by the Free Software Foundation; \r\n";
            lblOther.Text += "either version 2 of the license, or (at your option) any later version.\r\n";
            //setup mail links           
            this.lnkEmails.Links.Add(0, 12, "mailto:sachabarber@hotmail.com");
            //this.lnkEmails.Links.Add(15, 24, "mailto:jan.seda@skilldrive.com");

        }

        /// <summary>
        /// lnkWebSite click event, attempts to open the NetPics web site
        /// </summary>
        /// <param name="sender">the lnkWebSite hyperlink</param>
        /// <param name="e">the event args</param>
        private void lnkEmails_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // LinkData property of the Link object.
            string target = e.Link.LinkData as string;
            //start the link process
            startProcess(target);
        }

        /// <summary>
        /// frmAbout form load event, Calls the setUpFormText() method
        /// </summary>
        /// <param name="sender">the frmAbout form</param>
        /// <param name="e">the event args</param>
        private void About_Load(object sender, EventArgs e)
        {
            setUpFormText();
        }

        /// <summary>
        /// Attempts to start the process which has the name of the parameter supplied
        /// which will be a mailto: from one of the mail links being clicked
        /// </summary>
        /// <param name="target">The process info to start, mailto: in this case</param>
        private void startProcess(string target)
        {
            //try to start the correct app for the target
            try
            {
                System.Diagnostics.Process.Start(target);
            }
            catch (Exception ex)
            {
                Program.ErrorBox("Problem with starting process " + target + " in frmAbout : " +
                    "\r\n\r\n\r\n" + ex.Message);

            }
        }

        /// <summary>
        /// btnOk clicked, Closes this form
        /// </summary>
        /// <param name="sender">the btnOk button</param>
        /// <param name="e">the event args</param>
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion
    }
    #endregion
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Comments and Discussions