using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Windows.Forms.Design; namespace TrimWS { partial class FAbout : Form { #region log4net private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); #endregion //log4net #region vars #endregion //vars #region ctor public FAbout() { if (log.IsDebugEnabled) { log.Debug("Constructing"); } InitializeComponent(); string _assemblyVersion = "Unknowen Version"; try { _assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } catch { } _lblVersion.Text = _assemblyVersion; } #endregion //ctor #region public #region props #endregion //props #endregion //public #region private /// <summary> /// This method is for playing with Garbage Collection and is not considered functional code /// </summary> private void _forceGC() { if (log.IsInfoEnabled) { log.Info("Forcing Garbage Collection"); } if (log.IsInfoEnabled) { log.InfoFormat("Before collection: heap memory {0}", GC.GetTotalMemory(false)); } GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); if (log.IsInfoEnabled) { log.InfoFormat("After collection: heap memory {0}", GC.GetTotalMemory(false)); } } #endregion //private #region event handlers private void _btnOk_Click(object sender, EventArgs e) { if (log.IsInfoEnabled) { log.Info("Closing About"); } this.Close(); } private void _btnGarbageCollection_Click(object sender, EventArgs e) { } #endregion //event handlers } }
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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)