C# Language Specification


partial void OnNameChanged()



Download 0,75 Mb.
bet337/524
Sana06.01.2022
Hajmi0,75 Mb.
#324842
1   ...   333   334   335   336   337   338   339   340   ...   524
Bog'liq
CSharp Language Specification


partial void OnNameChanged();
}

If this class is compiled without any other parts, the defining partial method declarations and their invocations will be removed, and the resulting combined class declaration will be equivalent to the following:

class Customer
{
string name;

public string Name {

get { return name; }

set { name = value; }


}
}

Assume that another part is given, however, which provides implementing declarations of the partial methods:

partial class Customer
{
partial void OnNameChanging(string newName)
{
Console.WriteLine(“Changing “ + name + “ to “ + newName);
}

partial void OnNameChanged()


{
Console.WriteLine(“Changed to “ + name);
}
}

Then the resulting combined class declaration will be equivalent to the following:

class Customer
{
string name;

public string Name {

get { return name; }

set {
OnNameChanging(value);


name = value;
OnNameChanged();
}

}

void OnNameChanging(string newName)


{
Console.WriteLine(“Changing “ + name + “ to “ + newName);
}

void OnNameChanged()


{
Console.WriteLine(“Changed to “ + name);
}
}

      1. Download 0,75 Mb.

        Do'stlaringiz bilan baham:
1   ...   333   334   335   336   337   338   339   340   ...   524




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish