-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
namespace delegateEg | ||
{ | ||
// declaring delegate | ||
public delegate void dd(int x, int y); | ||
|
||
class A | ||
{ | ||
public void addition(int a, int b) | ||
{ | ||
Console.WriteLine("Addition = {0}", a+b); | ||
} | ||
} | ||
|
||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
A obj = new A(); | ||
dd obj2 = obj.addition; | ||
obj2(5, 10); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35323.107 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "delegateExample", "delegateExample.csproj", "{8630A501-E0F6-41F4-B924-47BC7BA49225}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8630A501-E0F6-41F4-B924-47BC7BA49225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8630A501-E0F6-41F4-B924-47BC7BA49225}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8630A501-E0F6-41F4-B924-47BC7BA49225}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8630A501-E0F6-41F4-B924-47BC7BA49225}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {76306F7A-E242-43F4-BA9C-17FD66E047AA} | ||
EndGlobalSection | ||
EndGlobal |