Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Default scope resolution

I have inherited a c# class 'Button' (which I can't change) which clashes with the BCL class 'Windows.Forms.Button'. Normally, Id be very happy to go:

MyPackage.MyClass.Button;

But there are a large number or references to this class which is a pain to have to re-type.

Is there any way to get the compiler (linker?) to default to using the customised version of Button over the BCL version?

like image 614
TK. Avatar asked Oct 06 '08 13:10

TK.


People also ask

Bahasa C digunakan untuk apa?

Meskipun C dibuat untuk memprogram sistem dan jaringan komputer namun bahasa ini juga sering digunakan dalam mengembangkan software aplikasi. C juga banyak dipakai oleh berbagai jenis platform sistem operasi dan arsitektur komputer, bahkan terdapat beberepa compiler yang sangat populer telah tersedia.

C dalam Latin berapa?

C adalah huruf ketiga dalam alfabet Latin. Dalam bahasa Indonesia, huruf ini disebut ce (dibaca [tʃe]).

3 Apa yang Anda ketahui tentang bahasa C jelaskan?

Bahasa Pemrograman C adalah sebuah bahasa pemrograman komputer yang bisa digunakan untuk membuat berbagai aplikasi (general-purpose programming language), mulai dari sistem operasi (seperti Windows atau Linux), antivirus, software pengolah gambar (image processing), hingga compiler untuk bahasa pemrograman, dimana C ...

Apakah C termasuk bahasa pemrograman?

Bahasa C atau dibaca “si” adalah bahasa pemrograman tingkat tinggi dan general-purpose yang digunakan dalam sehari-hari. Maksud dari general-purpose adalah bisa digunakan untuk membuat program apa saja.


1 Answers

Add this to the top of the file:

using MyButton = MyPackage.MyClass.Button;

Now you can reference your custom button using a distinct name. You may need to do something similar for the stock button if you use that anywhere in the same file.

like image 154
Joel Coehoorn Avatar answered Oct 10 '22 09:10

Joel Coehoorn