|
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;
namespace Mazzeranghi.StackLogger
{
public partial class MainFrame : Form
{
public MainFrame()
{
InitializeComponent();
}
private void ShowLog()
{
LogDisplay.Text = Logger.GetCurrentLog();
}
private void InvalidOperation_Click(Object p_Sender, EventArgs p_EventArgs)
{
try
{
var l_Account = new BankAccount(100);
l_Account.Withdraw(150);
}
catch (Exception p_Exception)
{
Logger.LogMessage(p_Exception.ToString());
}
ShowLog();
}
private void ValidOperationWithDefaultLog_Click(Object p_Sender, EventArgs p_EventArgs)
{
var l_Account = new BankAccount(100);
l_Account.Withdraw(50);
ShowLog();
}
private void ValidOperationWithCustomizedLog_Click(Object p_Sender, EventArgs p_EventArgs)
{
var l_Account = new BankAccount(100);
l_Account.Deposit(50);
ShowLog();
}
}
}
|
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.
Since 1998, I'm a software project leader at Esaote, one of the world's major manufacturers of non-invasive diagnostic equipment and system, as well as the leading European manufacturer of ultrasound imaging equipment.
My professional skills include:
- Programming Languages: C#, C/C++, ASP.NET, XML, XSLT, Prolog.
- Libraries: .NET Framework, STL, MFC.
- Paradigms and Standards: Object-Oriented Programming, Design Patterns, Code Generation, Extreme Programming, Design by Contract, Dicom.
- Tools: Visual Studio .NET, SQL Server.
You can contact me at my Web site (www.mazzeranghi.com).