C# delegate
C#
using System;
public class CargoAircraft
{
// Create a delegate type (no return no arguments)
public delegate void CheckQuantity();
// Create an instance of the delegate type
public CheckQuantity ProcessQuantity;
public void ProcessRequirements()
{
// Call the instance delegate
// Will invoke all methods mapped
ProcessQuantity();
}
}
public class CargoCounter
{
public void CountQuantity() { }
}
class Program
{
static void Main(string[] args)
{
CargoAircraft cargo = new CargoAircraft();
CargoCounter cargoCounter = new CargoCounter();
// Map a method to the created delegate
cargo.ProcessQuantity += cargoCounter.CountQuantity;
// Will call instance delegate invoking mapped methods
cargo.ProcessRequirements();
}
}
}
Also in C#:
- Title
- unity random int
- Category
- C#
- Title
- debug.log unity
- Category
- C#
- Title
- set textbox colour to transparent c#
- Category
- C#
- Title
- winforms timer c#
- Category
- C#
- Title
- unity get list length
- Category
- C#
- Title
- get absolute url c#
- Category
- C#
- Title
- c# split a string and return list
- Category
- C#
- Title
- increase variable C#
- Category
- C#
- Title
- c# request run as administrator
- Category
- C#
- Title
- textblock line break
- Category
- C#
- Title
- how to trigger event when a com device is connected in c#
- Category
- C#
- Title
- unity how to move an object to another object
- Category
- C#
- Title
- array copy c#
- Category
- C#
- Title
- moq raise event
- Category
- C#
- Title
- unity quaternion identity
- Category
- C#
- Title
- unity3d invector expand fsm controller
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- unity3d raycast
- Category
- C#
- Title
- office open xml check if row is empty
- Category
- C#
- Title
- binding c#
- Category
- C#
- Title
- c# random string
- Category
- C#
- Title
- flip boolean c#
- Category
- C#
- Title
- razor preview
- Category
- C#
- Title
- c sharp split string
- Category
- C#
- Title
- asking for user input integer c#
- Category
- C#
- Title
- c# inline initialize dictionary
- Category
- C#
- Title
- class selector to property in asp net core dropdown
- Category
- C#
- Title
- unity button interactable
- Category
- C#
- Title
- add row count devepxress report
- Category
- C#
- Title
- unity serializefield
- Category
- C#
- Title
- c sharp exit while loop
- Category
- C#
- Title
- start up file in asp.net core
- Category
- C#
- Title
- Could not load file or assembly 'Ubiety.Dns.Core, Version=2.2.1.0
- Category
- C#
- Title
- IEnumerator
- Category
- C#
- Title
- winforms c# add data to datagridview with a button
- Category
- C#
- Title
- csharp attributes as generics constraints
- Category
- C#
- Title
- c# get enum in list
- Category
- C#
- Title
- MVC company assignments
- Category
- C#
- Title
- what is type unity
- Category
- C#
- Title
- add variable to the beginning of a list c#
- Category
- C#
- Title
- c# storing value in session
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- c# list to string comma separated
- Category
- C#
- Title
- c# edit element in list
- Category
- C#
- Title
- c# list length
- Category
- C#
- Title
- convert to base64 c#
- Category
- C#
- Title
- c# xml file builder
- Category
- C#
- Title
- unity hide mouse first person
- Category
- C#
- Title
- fly cam extended script unity 3d
- Category
- C#
- Title
- linq in c#
- Category
- C#
- Title
- c# download file
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- C# loop through array of objet
- Category
- C#
- Title
- convert number of days into months c#
- Category
- C#
- Title
- how to set a transform equal to something unity
- Category
- C#
- Title
- leantween sequence
- Category
- C#
- Title
- c# nullable generic
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- c# string to byte array
- Category
- C#
- Title
- c# reverse a string for loop
- Category
- C#
- Title
- c# docstring
- Category
- C#
- Title
- combobox change datasource c#
- Category
- C#
- Title
- and unity
- Category
- C#
- Title
- c# get last character of string
- Category
- C#
- Title
- c# loop string array
- Category
- C#
- Title
- C# Into To Tring Debug.Log
- Category
- C#
- Title
- get user directory of file in c#
- Category
- C#
- Title
- iframe set html content c#
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- navigate to another page with an object uwp c#
- Category
- C#
- Title
- c# distinct array of objects by values
- Category
- C#
- Title
- c# capitalize first letter
- Category
- C#
- Title
- c# getter setter
- Category
- C#
- Title
- creating a c# class
- Category
- C#
- Title
- C# linq mselect
- Category
- C#
- Title
- return random from enum
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- count the number of notes in a given amount c#
- Category
- C#
- Title
- c# httpclient postasync stringcontent
- Category
- C#
- Title
- c# convert column name to number
- Category
- C#
- Title
- datagridview column color c#
- Category
- C#
- Title
- find month number from date C#
- Category
- C#
- Title
- c# convert excel column index to letter
- Category
- C#
- Title
- list.addrange in c#
- Category
- C#
- Title
- read xml file c#
- Category
- C#
- Title
- unity randomly generated numbers c#
- Category
- C#
- Title
- c# clear console read chache
- Category
- C#
- Title
- how to create and trigger a function unity animation events
- Category
- C#
- Title
- c# else if
- Category
- C#
- Title
- initialize matrix c#
- Category
- C#
- Title
- C# webclient immitate browser
- Category
- C#
- Title
- radians to degree c#
- Category
- C#
- Title
- c# multi threading example
- Category
- C#
- Title
- count number of enum values C#
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- unity load scene
- Category
- C#
- Title
- unity on trigger enter
- Category
- C#
- Title
- c# how to add newline on text box
- Category
- C#
- Title
- cannot convert string to generic type c#
- Category
- C#
- Title
- unity clamp rotation
- Category
- C#