arguments for a property

  • Thread starter Thread starter Z.K.
  • Start date Start date
Z

Z.K.

I was wondering if it is possible to send multiple arguments to a
property in C# like you can do with a method such as:

public double Average(int x, int y, int z) or

public double Average(params int [] numArray)

I have looked through the books I have, but I see no way to send more
than one argument at a time.

Z.K.
 
I was wondering if it is possible to send multiple arguments to a
property in C# like you can do with a method such as:

Only for default properties, aka indexers

public double this[int x, int y, int z]


Mattias
 
Hi,
I have looked through the books I have, but I see no way to send more than
one argument at a time.

It would look like a method then :

instance.Property( 1, 2, 3);

So, why not use a method in the first place?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top