|
using System;
using System.Windows.Forms;
using UnderTheHoodCSharp.Examples.LambdaExamples;
using UnderTheHoodCSharp.Examples.AnonymousTypeExamples;
using UnderTheHoodCSharp.Examples.IteratorExample;
namespace UnderTheHoodCSharp
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void btnForEach_Click(object sender, EventArgs e)
{
ForEachForm frm = new ForEachForm();
frm.Show();
}
private void btnEasyLambda_Click(object sender, EventArgs e)
{
LambdaForm frm = new LambdaForm(new EasyLambdaButtonFactory());
frm.Text += " (easy)";
frm.Show();
}
private void btnMediumLambda_Click(object sender, EventArgs e)
{
LambdaForm frm = new LambdaForm(new MediumLambdaButtonFactory());
frm.Text += " (medium)";
frm.Show();
}
private void btnHardLambda_Click(object sender, EventArgs e)
{
LambdaForm frm = new LambdaForm(new HardLambdaButtonFactory());
frm.Text += " (hard)";
frm.Show();
}
private void btnInsaneLambda_Click(object sender, EventArgs e)
{
LambdaForm frm = new LambdaForm(new InsaneLambdaButtonFactory());
frm.Text += " (insane)";
frm.Show();
}
private void btnInsaneRewritten_Click(object sender, EventArgs e)
{
LambdaForm frm = new LambdaForm(new InsaneLambdaFactoryRewritten());
frm.Text += " (insane rewritten)";
frm.Show();
}
private void btnAnonymousTypeFormal_Click(object sender, EventArgs e)
{
AnonymousTypeForm frm = new AnonymousTypeForm(new FormalNamePeopleFactory());
frm.Text += " (formal)";
frm.Show();
}
private void btnAnonymousTypeNickName_Click(object sender, EventArgs e)
{
AnonymousTypeForm frm = new AnonymousTypeForm(new NickNamePeopleFactory());
frm.Text += " (nickname)";
frm.Show();
}
private void btnAnonymousTypeBugged_Click(object sender, EventArgs e)
{
AnonymousTypeForm frm = new AnonymousTypeForm(new BuggedPeopleFactory());
frm.Text += " (bugged)";
frm.Show();
}
private void btnEmit_Click(object sender, EventArgs e)
{
EmitForm frm = new EmitForm("ExecuteILMethod");
frm.Text += " (emit)";
frm.Show();
}
private void btnExpressionTrees_Click(object sender, EventArgs e)
{
EmitForm frm = new EmitForm("ExecuteExpressionTreeMethod");
frm.Text += " (expression trees)";
frm.Show();
}
private void btnIterator_Click(object sender, EventArgs e)
{
MessageBox.Show(IteratorExample.UseTheItator(), "Iterator example", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
|
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.
Sander Rossel is a Microsoft certified professional developer with experience and expertise in .NET and .NET Core (C#, ASP.NET, and Entity Framework), SQL Server, Azure, Azure DevOps, JavaScript, MongoDB, and other technologies.
He is the owner of
JUUN Software, a company specializing in custom software. JUUN Software uses modern, but proven technologies, such as .NET Core, Azure and Azure DevOps.
You can't miss
his books on Amazon and
his free e-books on Syncfusion!
He wrote a JavaScript LINQ library,
arrgh.js (works in IE8+, Edge, Firefox, Chrome, and probably everything else).
Check out his
prize-winning articles on CodeProject as well!