المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Indexers Question



C# Programming
09-01-2009, 02:00 PM
Hi all,

I am looking for a more advance way of using an indexers. I have searched the net but cannot find anything that explains how I must accomplish the following:

I have three classes namely: Building, Controller, Reader (each with their own fields/properties/methods). I want to make use of an indexer to reference each of the classes so that it can following this pattern:


Building["MyBuilding"].******** = ".....";
Building["MyBuilding"].Controller["MyController"].Area = ".....";
Building["MyBuilding"].Controller["MyController"].Reader["myReader"].Tag = "......";



Many thanks in advance
Kind regards,



The only programmers that are better C# programmers, are those who look like this -> http://www.barakasoft.com/script/Forums/Images/alien.gif


http://www.barakasoft.com/script/Forums/Images/coffee.gif Programm3r
My Blog: ^_^ (http://www.codeproject.com/script/profile/whos_who.asp?msg=1917620&id=2823228#xx1917620xx)