c#


Where should I declare my delegate method? [on hold]


public delegate void CalcOperation(b.ItemName,b.Quantity,b.Price);
where should I declare this delegate?
public class Program
{
public static void Main(string[] args)
{
Billing b=new Billing();
Console.WriteLine("Enter item name");
b.ItemName=Console.ReadLine();
Console.WriteLine("Enter quantity and price of the item purchased");
b.Quantity=int.Parse(Console.ReadLine());
b.Price=Double.Parse(Console.ReadLine());
Console.WriteLine("Item Name:{0}",b.ItemName);
Console.WriteLine("Quantity:{0}",b.Quantity);
Console.WriteLine("Price:{0}",b.Price);
CalcOperation c1 = new CalcOperation(Calculate);
c1(b.Quantity,b.Price);
}
}
public class Billing
{
public string ItemName;
public int Quantity;
public double Price;
public static void Calculate(int Quantity,double Price)
{
Console.WriteLine("Total Amount:{0}",Quantity*Price);
}
}

Related Links

MVC Default Area Not working
Index (zero based) must be greater than or equal to zero and less than the size of the argument list [closed]
Sprite Targeting
How to smoothly play a sequence of videos with WPF's MediaElement?
Creating Zip without third party DLLs. Getting Part URI must start with a forward slash error
Creating a list of static objects in asp.net
How can I get the StripOffsets tag to stay the same when using the LibTiff.Net 2.3 library?
Iterate a group in active directory using C Sharp
Type . insted of ,
Client HTTP Handling & ETag
Missing network sent/received
Read XML response webservice
using .Equals() failing in Predicatebuilder
Can I delete xxxxxxxAreaRegistration.cs?
jqgrid toolbar search or external search feature
Splitting individual element in a List<string>?

Categories

HOME
gcc
primefaces
system-calls
compression
ldap
grpc
android-ndk
bigtable
dynamic
conceptual
pandoc
servicenow
open-search-server
rmarkdown
doctrine2
vsixmanifest
restheart
subprocess
dcos
aspectj
hql
web-parts
novacode-docx
beacon
oracle-golden-gate
oracle10g
scalatest
ballerinalang
large-files
request-uri
cqlsh
xlib
undo
imdb
rtos
flickr
offset
apache-falcon
respect-validation
hippocms
rtsp
byobu
pyexcel
java-5
jenkins-2
ear
runtime-permissions
node-java
critical-section
reloaddata
lightspeed
stringbuilder
glade
distcc
symantec
boost-range
cosign-api
hfp
diameter-protocol
supervised-learning
audiorecord
3d-rendering
boost-propertytree
treelist
pyshark
bbedit
nugetgallery
jquery-draggable
web-performance
app-data
skscene
ios8-share-extension
sdkman
database-project
lytro
traminer
android-filterable
azure-mobile-app
android-networking
tidesdk
chunks
teamstudio-unplugged
shunting-yard
kss
windows-search
oxygenxml
fscanf
rda
jsmpp
farpoint-spread
internet-radio
data-layers
flask-mongoengine
xrandr
infinity.js
pudb
gssapi
helicontech
pinchzoom
commonsware
virtual-printer
netbeans7.0
http-response-codes
text-manipulation
opengl-to-opengles
disk-based
managed-code
office-2003
hotfix

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App