Click here to Skip to main content
15,897,519 members
Articles / Desktop Programming / Windows Forms

Aspect Oriented Programming for Benchmarking

Rate me:
Please Sign up or sign in to vote.
4.64/5 (16 votes)
1 Jul 2007CPOL9 min read 74.3K   352   57  
This article explains how you can use AOP for benchmarking purposes.
namespace Benchmarking
{
    partial class frmBenchmark
    {
        /// <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.lvwTiming = new System.Windows.Forms.ListView();
            this.className = new System.Windows.Forms.ColumnHeader();
            this.memberName = new System.Windows.Forms.ColumnHeader();
            this.arguments = new System.Windows.Forms.ColumnHeader();
            this.elapsedTime = new System.Windows.Forms.ColumnHeader();
            this.btnClose = new System.Windows.Forms.Button();
            this.btnCopy = new System.Windows.Forms.Button();
            this.btnReset = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // lvwTiming
            // 
            this.lvwTiming.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.lvwTiming.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.className,
            this.memberName,
            this.arguments,
            this.elapsedTime});
            this.lvwTiming.FullRowSelect = true;
            this.lvwTiming.GridLines = true;
            this.lvwTiming.Location = new System.Drawing.Point(12, 12);
            this.lvwTiming.Name = "lvwTiming";
            this.lvwTiming.Size = new System.Drawing.Size(653, 335);
            this.lvwTiming.TabIndex = 0;
            this.lvwTiming.UseCompatibleStateImageBehavior = false;
            this.lvwTiming.View = System.Windows.Forms.View.Details;
            // 
            // className
            // 
            this.className.Text = "Class Name";
            this.className.Width = 92;
            // 
            // memberName
            // 
            this.memberName.Text = "Member Name";
            this.memberName.Width = 107;
            // 
            // arguments
            // 
            this.arguments.Text = "Arguments";
            this.arguments.Width = 353;
            // 
            // elapsedTime
            // 
            this.elapsedTime.Text = "Elapsed Time";
            this.elapsedTime.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.elapsedTime.Width = 92;
            // 
            // btnClose
            // 
            this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnClose.Location = new System.Drawing.Point(590, 353);
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(75, 23);
            this.btnClose.TabIndex = 1;
            this.btnClose.Text = "C&lose";
            this.btnClose.UseVisualStyleBackColor = true;
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            // 
            // btnCopy
            // 
            this.btnCopy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnCopy.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCopy.Location = new System.Drawing.Point(12, 353);
            this.btnCopy.Name = "btnCopy";
            this.btnCopy.Size = new System.Drawing.Size(114, 23);
            this.btnCopy.TabIndex = 2;
            this.btnCopy.Text = "&Copy to clipboard";
            this.btnCopy.UseVisualStyleBackColor = true;
            this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
            // 
            // btnReset
            // 
            this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnReset.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnReset.Location = new System.Drawing.Point(132, 353);
            this.btnReset.Name = "btnReset";
            this.btnReset.Size = new System.Drawing.Size(114, 23);
            this.btnReset.TabIndex = 3;
            this.btnReset.Text = "&Reset Time sheet";
            this.btnReset.UseVisualStyleBackColor = true;
            this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
            // 
            // frmBenchmark
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(677, 384);
            this.Controls.Add(this.btnReset);
            this.Controls.Add(this.btnCopy);
            this.Controls.Add(this.btnClose);
            this.Controls.Add(this.lvwTiming);
            this.Name = "frmBenchmark";
            this.Text = "AOP Benchmarking";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ListView lvwTiming;
        private System.Windows.Forms.ColumnHeader memberName;
        private System.Windows.Forms.Button btnClose;
        private System.Windows.Forms.ColumnHeader className;
        private System.Windows.Forms.ColumnHeader elapsedTime;
        private System.Windows.Forms.ColumnHeader arguments;
        private System.Windows.Forms.Button btnCopy;
        private System.Windows.Forms.Button btnReset;


    }
}

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
Instructor / Trainer Alura Cursos Online
Brazil Brazil

Comments and Discussions