Click here to Skip to main content
12,816,490 members (34,131 online)
Click here to Skip to main content

Stats

120.7K views
2.2K downloads
235 bookmarked
Posted 20 Jul 2009

Finding Undisposed Objects

, 13 Aug 2009 Ms-PL
An application to find undisposed objects in your .NET application.
namespace UndisposedViewer
{
    partial class MainForm
    {
        /// <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.label1 = new System.Windows.Forms.Label();
            this.executablePathTextBox = new System.Windows.Forms.TextBox();
            this.browseButton = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.commandlineArgumentsTextBox = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.logfilePathTextBox = new System.Windows.Forms.TextBox();
            this.goButton = new System.Windows.Forms.Button();
            this.typeFilterTextBox = new System.Windows.Forms.TextBox();
            this.findFinalizableTypesLabel = new System.Windows.Forms.LinkLabel();
            this.finalizableTypeFinderWorker = new System.ComponentModel.BackgroundWorker();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(50, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(87, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Executable path:";
            // 
            // executablePathTextBox
            // 
            this.executablePathTextBox.Location = new System.Drawing.Point(144, 13);
            this.executablePathTextBox.Name = "executablePathTextBox";
            this.executablePathTextBox.Size = new System.Drawing.Size(342, 20);
            this.executablePathTextBox.TabIndex = 1;
            // 
            // browseButton
            // 
            this.browseButton.Location = new System.Drawing.Point(492, 10);
            this.browseButton.Name = "browseButton";
            this.browseButton.Size = new System.Drawing.Size(75, 23);
            this.browseButton.TabIndex = 2;
            this.browseButton.Text = "&Browse";
            this.browseButton.UseVisualStyleBackColor = true;
            this.browseButton.Click += new System.EventHandler(this.browseButton_Click);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(12, 44);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(125, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "Commandline arguments:";
            // 
            // commandlineArgumentsTextBox
            // 
            this.commandlineArgumentsTextBox.Location = new System.Drawing.Point(144, 37);
            this.commandlineArgumentsTextBox.Name = "commandlineArgumentsTextBox";
            this.commandlineArgumentsTextBox.Size = new System.Drawing.Size(342, 20);
            this.commandlineArgumentsTextBox.TabIndex = 4;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(69, 71);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(68, 13);
            this.label3.TabIndex = 5;
            this.label3.Text = "Log file path:";
            // 
            // logfilePathTextBox
            // 
            this.logfilePathTextBox.Location = new System.Drawing.Point(144, 63);
            this.logfilePathTextBox.Name = "logfilePathTextBox";
            this.logfilePathTextBox.Size = new System.Drawing.Size(193, 20);
            this.logfilePathTextBox.TabIndex = 6;
            // 
            // goButton
            // 
            this.goButton.Location = new System.Drawing.Point(233, 281);
            this.goButton.Name = "goButton";
            this.goButton.Size = new System.Drawing.Size(75, 23);
            this.goButton.TabIndex = 8;
            this.goButton.Text = "&Go";
            this.goButton.UseVisualStyleBackColor = true;
            this.goButton.Click += new System.EventHandler(this.goButton_Click);
            // 
            // typeFilterTextBox
            // 
            this.typeFilterTextBox.Location = new System.Drawing.Point(6, 41);
            this.typeFilterTextBox.Multiline = true;
            this.typeFilterTextBox.Name = "typeFilterTextBox";
            this.typeFilterTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.typeFilterTextBox.Size = new System.Drawing.Size(540, 123);
            this.typeFilterTextBox.TabIndex = 9;
            // 
            // findFinalizableTypesLabel
            // 
            this.findFinalizableTypesLabel.AutoSize = true;
            this.findFinalizableTypesLabel.Location = new System.Drawing.Point(6, 19);
            this.findFinalizableTypesLabel.Name = "findFinalizableTypesLabel";
            this.findFinalizableTypesLabel.Size = new System.Drawing.Size(166, 13);
            this.findFinalizableTypesLabel.TabIndex = 11;
            this.findFinalizableTypesLabel.TabStop = true;
            this.findFinalizableTypesLabel.Text = "Automatically find finalizable types";
            this.findFinalizableTypesLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.findFinalizableTypesLabel_LinkClicked);
            // 
            // finalizableTypeFinderWorker
            // 
            this.finalizableTypeFinderWorker.WorkerReportsProgress = true;
            this.finalizableTypeFinderWorker.WorkerSupportsCancellation = true;
            this.finalizableTypeFinderWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.finalizableTypeFinderWorker_DoWork);
            this.finalizableTypeFinderWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.finalizableTypeFinderWorker_RunWorkerCompleted);
            this.finalizableTypeFinderWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.finalizableTypeFinderWorker_ProgressChanged);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.typeFilterTextBox);
            this.groupBox1.Controls.Add(this.findFinalizableTypesLabel);
            this.groupBox1.Location = new System.Drawing.Point(12, 105);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(552, 170);
            this.groupBox1.TabIndex = 12;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Types to monitor";
            // 
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(576, 316);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.goButton);
            this.Controls.Add(this.logfilePathTextBox);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.commandlineArgumentsTextBox);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.browseButton);
            this.Controls.Add(this.executablePathTextBox);
            this.Controls.Add(this.label1);
            this.MaximizeBox = false;
            this.Name = "MainForm";
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.Text = "Undisposed";
            this.Load += new System.EventHandler(this.MainForm_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox executablePathTextBox;
        private System.Windows.Forms.Button browseButton;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox commandlineArgumentsTextBox;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox logfilePathTextBox;
        private System.Windows.Forms.Button goButton;
        private System.Windows.Forms.TextBox typeFilterTextBox;
        private System.Windows.Forms.LinkLabel findFinalizableTypesLabel;
        private System.ComponentModel.BackgroundWorker finalizableTypeFinderWorker;
        private System.Windows.Forms.GroupBox groupBox1;
    }
}

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)

Share

About the Author

S. Senthil Kumar
Software Developer Atmel R&D India Pvt. Ltd.
India India
I'm a 27 yrs old developer working with Atmel R&D India Pvt. Ltd., Chennai. I'm currently working in C# and C++, but I've done some Java programming as well. I was a Microsoft MVP in Visual C# from 2007 to 2009.

You can read My Blog here. I've also done some open source software - please visit my website to know more.

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 13 Aug 2009
Article Copyright 2009 by S. Senthil Kumar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid