if you want to access an array like a property, use an indexer.

On Tue, Dec 9, 2008 at 11:48 AM, Edgard Matos <[EMAIL PROTECTED]> wrote:

> If Do I store my Objects in ArrayList, how I access directly?
> How do I to call diff methods of each Object?
>
>
> Atenciosamente,
> Edgard Matos
>
>
>
> On Tue, Dec 9, 2008 at 1:15 PM, Kaarthik Padmanabhan <[EMAIL PROTECTED]
> > wrote:
>
>> maybe yeah, lets wait to hear from him.
>>
>>
>> On Tue, Dec 9, 2008 at 9:36 PM, Brandon Betances <[EMAIL PROTECTED]>wrote:
>>
>>> maybe hes trying to make a property that gets an array? theres indexers
>>> for that.
>>>
>>>
>>> On Tue, Dec 9, 2008 at 10:12 AM, Kaarthik Padmanabhan <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>> Hi,
>>>> It is not exactly possible the same way as you have shown in JavaScript.
>>>> If you want to store an array of multiple type objects, then probably
>>>> you need something like an ArrayList.
>>>>
>>>> However, if you want to know how to add properties dynamically to an
>>>> object, it gets a bit complex.
>>>> Here is a VB.Net example at:
>>>> http://coding-passion.blogspot.com/2008/12/adding-properties-to-object-dynamically.html
>>>>  that
>>>> you may want to check out.
>>>>
>>>> Regards,
>>>> Kaarthik
>>>>
>>>>   On Tue, Dec 9, 2008 at 4:52 PM, Edgard Matos <[EMAIL PROTECTED]>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Do you know how to create dinamic properties in C# Objects?
>>>>>
>>>>> In JavaScript I create like this:
>>>>> *var obj = new Object();*
>>>>> *obj["propOne"] = "test";*
>>>>> *obj["propTwo"] = new Array();*
>>>>>
>>>>> I need to access directly properties using Object["prop"]
>>>>> How do I do this with C#?
>>>>>
>>>>> Very thanks!
>>>>>
>>>>>
>>>>> Edgard Matos
>>>>> E-mail: [EMAIL PROTECTED]
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kaarthik,
>>>> http://coding-passion.blogspot.com
>>>>
>>>
>>>
>>
>>
>> --
>> Kaarthik,
>> http://coding-passion.blogspot.com
>>
>
>

Reply via email to