Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
コード例 #1
0
        /// <summary>
        ///     Run-method of the display thread. Shows the form and waits
        ///     for the end.
        /// </summary>
        /// <param name="center">The center of the form.</param>
        private static void Run(object center)
        {
            Point             point        = ( Point )center;
            PDFExportProgress progressForm = new PDFExportProgress( );

            progressForm.Location = new Point(point.X - progressForm.Width / 2, point.Y - progressForm.Height / 2);
            progressForm.Show( );

            try
            {
                while (true)
                {
                    Thread.Sleep(5);
                    Application.DoEvents( );
                }
            }
            catch (ThreadAbortException)
            {
                //We are asked to close the window
                progressForm.Close( );
                progressForm.Dispose( );
            }
        }
コード例 #2
0
ファイル: PDFExportProgress.cs プロジェクト: gbaychev/NClass
    /// <summary>
    /// Run-method of the display thread. Shows the form and waits
    /// for the end.
    /// </summary>
    /// <param name="center">The center of the form.</param>
    private static void Run(Object center)
    {
      Point point = (Point)center;
      PDFExportProgress progressForm = new PDFExportProgress();
      progressForm.Location = new Point(point.X - progressForm.Width/2, point.Y - progressForm.Height/2);
      progressForm.Show();

      try
      {
        while(true)
        {
          Thread.Sleep(5);
          Application.DoEvents();
        }
      }
      catch(ThreadAbortException)
      {
        //We are asked to close the window
        progressForm.Close();
        progressForm.Dispose();
      }
    }