|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace GenericPropertyWindows
{
public partial class MainFrame : Form
{
public MainFrame()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Employee emp = new Employee();
emp.Name = "Kith";
emp.LastName = "Kanan";
emp.Age = 22;
PropertyWindow<Employee> wndProp = new PropertyWindow<Employee>(emp);
wndProp.ShowDialog(this);
MessageBox.Show(string.Format(
"After modifying Employee:\nName: {0}\nLastName: {1}\nAge: {2}",
emp.Name,
emp.LastName,
emp.Age)
);
}
private void button2_Click(object sender, EventArgs e)
{
PropertyWindow<Account> wndProp = new PropertyWindow<Account>();
wndProp.ShowDialog(this);
Account acc = wndProp.Property;
MessageBox.Show(string.Format(
"After modifying Account:\nName: {0}\nBalance: {1}\nExpiration: {2}\nPIN:{3}",
acc.AccountName,
acc.Balance,
acc.ExpirationDate,
acc.PIN)
);
}
}
}
|
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.