Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / C#

XmlStore Part 2: Printing DataGridView Contents

Rate me:
Please Sign up or sign in to vote.
4.71/5 (7 votes)
18 Mar 2007CPOL7 min read 70K   3.4K   51  
A utility to read, edit, encrypt, decrypt, write and print XmlStore files
using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;



namespace VVX
{
    class About
    {
        // **************************************************
        // Modified: 2007.03.14
        // **************************************************
        private const string MODULE_NAME = "VVX.About";
        private const string LAST_MODIFIED = "2007.03.14";

        //---------------------------------------------------
        public static string VersionGet()
        {
            return "Last Modified " + LAST_MODIFIED;
        }

        //---------------------------------------------------
        public static void Version()
        {
            MsgBox.Info(VersionGet(), MODULE_NAME);
        }

        //---------------------------------------------------
        /// <summary>
        /// Cheap "About" MessageBox. Reads info from the assembly info in the EXE.
        /// To use simply connect the Help > About command's click handler to call this
        /// static method.
        /// </summary>
        public static void Show()
        {
            string sMsg = "";
            string sEOL = Environment.NewLine;

            //--- create an instance for the assembly
            Assembly appAssembly = Assembly.GetExecutingAssembly();

            //--- create an instance of file FileVersionInfo
            FileVersionInfo appFile = FileVersionInfo.GetVersionInfo(appAssembly.Location);

            //--- WARNING: This sounds crazy, but the value of "AssemblyDescription"
            //    has to be accessed using the "Comments" element of FileVersionInfo.
            string sDescription = appFile.Comments;

            sMsg = String.Format("{0}\n\nVersion {1}:{2}"
                                , sDescription
                                , appFile.FileMajorPart
                                , appFile.FileMinorPart);

            if (appFile.FileBuildPart != 0 || appFile.FilePrivatePart != 0 )
            {
                sMsg += String.Format(":{0}:{1}"
                                , appFile.FileBuildPart
                                , appFile.FilePrivatePart);

            }

            string sAppName = appAssembly.GetName().Name;
            string sCopyright = appFile.LegalCopyright;
            sMsg += sEOL + sCopyright;

            MsgBox.Info(sAppName, sMsg);
        }
    }
}

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
United States United States
An old dog trying to learn new tricks!

Comments and Discussions