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

How To Configure Multiple ISessionFactory in NHibernate?
Xamarin Button IsVisible Binding with ValueConverter not working
Unable to get TSC-TDP247 Printer Status from c#
passing a null value to the database from a dropdownlist in the form of boolean in c#
General function failure [Grid_266]
Sending Lotus Notes email through C# hiding SentBy field
Activityindicator stops spinning in Xamarin.forms
Posting Collection to OData Controller not returning nested collection property to client
How do I modify the rich text box control to simulate a code editor [closed]
How to insert Dot on Each character
UWP Xbox One difference between running in Retail to Dev Mode
MSBuild Build same DLL with two different projects
ILMerge.Merge: ERROR
Draw text centered in a ellipse/circle in winforms application
c# android bluetooth get socket from connected device
How to make a field auto populate in C# Visual Studio?

Categories

HOME
asp.net
drupal
url
kendo-ui
wifi
abc
glsl
x509certificate
where
mediarecorder
kohana
hibernate-mapping
promotions
activejdbc
jpql
swift3.1
jsfiddle
luis
passbook
custom-component
android-wifi
restructuredtext
pumping-lemma
azure-table-storage
csproj
federated
ds-5
concrete5
choco
oracle-nosql
repeat
outlook-2010
mongoid5
stencyl
area
ngrok
lfe
ape-phylo
definition
irr
test-kitchen
firefox-developer-edition
piranha-cms
reqif
serverless-architecture
geminabox
django-tables2
dcom
runtime-permissions
rmq
wicketstuff
firebase-polymer
scikit-image
dimensionality-reduction
foreground
csc
kik
supervised-learning
razorengine
jmap
sqlxml
computability
consul-template
avrcp
android-networking
autopep8
mri
sony-xperia
indices
teamstudio-unplugged
javadb
xmlserializer
famous-engine
ccmenuitem
dateadd
jsmpp
slimscroll
nop
xcode6.1-gm-seed
urlfetch
cron4j
orchestration
nserror
advanceddatagrid
scsf
discussion-board
soapexception
backlight
functional-specifications
cryptolicensing
mass-emails
s60
chars
browser-state
miniport
mysql-logic
coderush-xpress
pixel-bender
rpxnow
html-help-workshop
disk-based
cstring
high-load

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