Click here to Skip to main content
15,881,027 members
Articles / Desktop Programming / Win32

Application Management

Rate me:
Please Sign up or sign in to vote.
3.71/5 (5 votes)
18 Feb 2010Ms-PL3 min read 27.4K   649   48  
Application Management makes your application's life easier. It will automatically do memory management, handle and log unhandled exceptions, profile your functions, make your application single instance, and also provide utility functions to get system information.
namespace MyTestApp
{
    partial class MainFrm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (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.cbMemManagement = new System.Windows.Forms.CheckBox();
            this.cbExceptionsHandler = new System.Windows.Forms.CheckBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.btnClearExLogs = new System.Windows.Forms.Button();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.btnThrowException = new System.Windows.Forms.Button();
            this.cbExceptions = new System.Windows.Forms.ComboBox();
            this.btnExplore = new System.Windows.Forms.Button();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.lbOS = new System.Windows.Forms.Label();
            this.lbProcessorCount = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.SuspendLayout();
            // 
            // cbMemManagement
            // 
            this.cbMemManagement.AutoSize = true;
            this.cbMemManagement.Checked = true;
            this.cbMemManagement.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbMemManagement.Location = new System.Drawing.Point(6, 19);
            this.cbMemManagement.Name = "cbMemManagement";
            this.cbMemManagement.Size = new System.Drawing.Size(128, 17);
            this.cbMemManagement.TabIndex = 0;
            this.cbMemManagement.Text = "Memory Management";
            this.cbMemManagement.UseVisualStyleBackColor = true;
            this.cbMemManagement.CheckedChanged += new System.EventHandler(this.CheckedChanged);
            // 
            // cbExceptionsHandler
            // 
            this.cbExceptionsHandler.AutoSize = true;
            this.cbExceptionsHandler.Checked = true;
            this.cbExceptionsHandler.CheckState = System.Windows.Forms.CheckState.Checked;
            this.cbExceptionsHandler.Location = new System.Drawing.Point(6, 42);
            this.cbExceptionsHandler.Name = "cbExceptionsHandler";
            this.cbExceptionsHandler.Size = new System.Drawing.Size(118, 17);
            this.cbExceptionsHandler.TabIndex = 1;
            this.cbExceptionsHandler.Text = "Exceptions Handler";
            this.cbExceptionsHandler.UseVisualStyleBackColor = true;
            this.cbExceptionsHandler.CheckedChanged += new System.EventHandler(this.CheckedChanged);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.btnExplore);
            this.groupBox1.Controls.Add(this.btnClearExLogs);
            this.groupBox1.Controls.Add(this.cbMemManagement);
            this.groupBox1.Controls.Add(this.cbExceptionsHandler);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(351, 72);
            this.groupBox1.TabIndex = 2;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Library Components";
            // 
            // btnClearExLogs
            // 
            this.btnClearExLogs.Location = new System.Drawing.Point(130, 38);
            this.btnClearExLogs.Name = "btnClearExLogs";
            this.btnClearExLogs.Size = new System.Drawing.Size(147, 23);
            this.btnClearExLogs.TabIndex = 2;
            this.btnClearExLogs.Text = "Clear logs and dump Files";
            this.btnClearExLogs.UseVisualStyleBackColor = true;
            this.btnClearExLogs.Click += new System.EventHandler(this.ButtonClick);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.btnThrowException);
            this.groupBox2.Controls.Add(this.cbExceptions);
            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox2.Location = new System.Drawing.Point(0, 72);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(351, 54);
            this.groupBox2.TabIndex = 3;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Exceptions";
            // 
            // btnThrowException
            // 
            this.btnThrowException.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.btnThrowException.Location = new System.Drawing.Point(293, 17);
            this.btnThrowException.Name = "btnThrowException";
            this.btnThrowException.Size = new System.Drawing.Size(46, 23);
            this.btnThrowException.TabIndex = 3;
            this.btnThrowException.Text = "Throw";
            this.btnThrowException.UseVisualStyleBackColor = true;
            this.btnThrowException.Click += new System.EventHandler(this.ButtonClick);
            // 
            // cbExceptions
            // 
            this.cbExceptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.cbExceptions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbExceptions.FormattingEnabled = true;
            this.cbExceptions.Items.AddRange(new object[] {
            "SystemException",
            "AccessViolationException",
            "ArgumentException",
            "ArgumentNullException",
            "ArgumentOutOfRangeException",
            "ArithmeticException",
            "ArrayTypeMismatchException",
            "BadImageFormatException",
            "CoreException",
            "DivideByZeroException",
            "FormatException",
            "IndexOutOfRangeException",
            "InvalidCastExpression",
            "InvalidOperationException",
            "MissingMemberException",
            "NotFiniteNumberException",
            "NotSupportedException",
            "NullReferenceException",
            "OutOfMemoryException",
            "StackOverflowException",
            "SqlException"});
            this.cbExceptions.Location = new System.Drawing.Point(6, 19);
            this.cbExceptions.Name = "cbExceptions";
            this.cbExceptions.Size = new System.Drawing.Size(281, 21);
            this.cbExceptions.TabIndex = 0;
            // 
            // btnExplore
            // 
            this.btnExplore.Location = new System.Drawing.Point(282, 38);
            this.btnExplore.Name = "btnExplore";
            this.btnExplore.Size = new System.Drawing.Size(63, 23);
            this.btnExplore.TabIndex = 4;
            this.btnExplore.Text = "Explore";
            this.btnExplore.UseVisualStyleBackColor = true;
            this.btnExplore.Click += new System.EventHandler(this.ButtonClick);
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.lbProcessorCount);
            this.groupBox3.Controls.Add(this.lbOS);
            this.groupBox3.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox3.Location = new System.Drawing.Point(0, 126);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(351, 59);
            this.groupBox3.TabIndex = 4;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "System Information";
            // 
            // lbOS
            // 
            this.lbOS.AutoSize = true;
            this.lbOS.Location = new System.Drawing.Point(3, 16);
            this.lbOS.Name = "lbOS";
            this.lbOS.Size = new System.Drawing.Size(134, 13);
            this.lbOS.TabIndex = 0;
            this.lbOS.Text = "Operative System: unkown";
            // 
            // lbProcessorCount
            // 
            this.lbProcessorCount.AutoSize = true;
            this.lbProcessorCount.Location = new System.Drawing.Point(8, 39);
            this.lbProcessorCount.Name = "lbProcessorCount";
            this.lbProcessorCount.Size = new System.Drawing.Size(97, 13);
            this.lbProcessorCount.TabIndex = 1;
            this.lbProcessorCount.Text = "Processor Count: 2";
            // 
            // MainFrm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(351, 187);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MaximumSize = new System.Drawing.Size(357, 215);
            this.MinimumSize = new System.Drawing.Size(357, 215);
            this.Name = "MainFrm";
            this.Text = "ApplicationManagement Library Test";
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.CheckBox cbMemManagement;
        private System.Windows.Forms.CheckBox cbExceptionsHandler;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button btnClearExLogs;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.Button btnThrowException;
        private System.Windows.Forms.ComboBox cbExceptions;
        private System.Windows.Forms.Button btnExplore;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.Label lbProcessorCount;
        private System.Windows.Forms.Label lbOS;
    }
}

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 Microsoft Public License (Ms-PL)


Written By
Portugal Portugal
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions