Professional Documents
Culture Documents
Delegates Demo
Delegates Demo
namespace ConsoleUI
{
class Program
{
static ShoppingCartModel cart = new ShoppingCartModel();
Console.WriteLine();
Console.Write("Please press any key to exit the application...");
Console.ReadKey();
}
namespace DemoLibrary
{
public class ProductModel
{
public string ItemName { get; set; }
public decimal Price { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DemoLibrary
{
public class ShoppingCartModel
{
public delegate void MentionDiscount(decimal subTotal);
mentionSubtotal(subTotal);
return total;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinFormUI
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Dashboard());
}
}
}