~/src/www.mokhan.ca/xlgmokha [main]
cat system-windows-forms-control-companyname.md
system-windows-forms-control-companyname.md 1817 bytes | 2007-08-22 00:00
symlink: /opt/dotnet/system-windows-forms-control-companyname.md

System.Windows.Forms.Control.CompanyName?

This messed me up a bit… I have a view that has a property called CompanyName

public interface ICaptureCompanyDetailsView
{
  string CompanyName { get; }

When my presenter was actually getting the company it was not getting stored as what I intended, because I had not implemented the “CompanyName” property on my actual view.

How did this compile?… It turns out that System.Windows.Forms.Control has a property called CompanyName. Hmm…

The temporary solution… “C# Shadow Field”! (Notice the new keyword)

public new string CompanyName
{
  get { return uxCompanyNameTextBox.Text; }
}