This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy


Building CommonSnappableTypes.dll



Download 21,46 Mb.
Pdf ko'rish
bet1074/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   1070   1071   1072   1073   1074   1075   1076   1077   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

Building CommonSnappableTypes.dll

The first order of business is to create an assembly that contains the types that a given snap-in must

leverage to be plugged into the expandable Windows Forms application. The CommonSnappable-

Types Class Library project defines two types:

namespace CommonSnappableTypes

{

public interface IAppFunctionality



{

void DoIt();

}

[AttributeUsage(AttributeTargets.Class)]



public sealed class CompanyInfoAttribute : System.Attribute

{

private string companyName;



private string companyUrl;

public CompanyInfoAttribute(){}

public string Name

{

get { return companyName; }



set { companyName = value; }

}

public string Url



{

get { return companyUrl; }

set { companyUrl = value; }

}

}



}

The IAppFunctionality interface provides a polymorphic interface for all snap-ins that can be

consumed by the extendable Windows Forms application. Given that this example is purely illustra-

tive, you supply a single method named DoIt(). A more realistic interface (or a set of interfaces)

might allow the object to generate scripting code, render an image onto the application’s toolbox, or

integrate into the main menu of the hosting application.

The CompanyInfoAttribute type is a custom attribute that will be applied on any class type

that wishes to be snapped in to the container. As you can tell by the definition of this class,

[CompanyInfo] allows the developer of the snap-in to provide some basic details about the compo-

nent’s point of origin.

C H A P T E R   1 6  


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   1070   1071   1072   1073   1074   1075   1076   1077   ...   1830




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