How to access parameterized property in C#?

W

Wayne Wood

i posted this problem on microsoft.public.excel.programming, but there's
no one replied till now. because this issue is time critical, i put it
here to try my fortune :)

------------------------------------------------------------------------

I am just a fresh man for C# programming, but i found that C# have no
support for optional parameter or parameterized property, which are
supported in VB.NET.

everybody kowns that Office programming is based on vb style language,
so now i have to access parameterized properties such as
Excel.WorkSheet.Cells(X, Y)
i was told that Cells is a property, not a method. i wonder how to pass
parameters to a property like Cells, if there's no way, logic will be
more complicated i think.

does some people have some good suggestions about optional parameters
and parameterized properties in Office programming, would you like to
shed some light? :)

thanks for listenning
 
C

Chad Z. Hower aka Kudzu

Wayne Wood said:
does some people have some good suggestions about optional parameters
and parameterized properties in Office programming, would you like to
shed some light? :)

COM is different than how C# handles issues itslef. For COM you pass Missing to specify the
paraameter is not being used.

For indexed properties, use [ ] instead of ( )


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
 
W

Wayne Wood

i mean, you know, there are so many "parameterized properties" and
"optional arguments" in Excel Object Model or so, and i DID deal with
that well in VB.NET, because of its support for these concepts. i also
know there are really some differences between VB.NET and C#, but after
all, they are designed for the same platform, so are you telling me that
something that can be done with VB.NET can not be done with C#? that's
critical, i think i have no time to rewrite the whole code :(

by the way, did you mean COM can support parameterized properties, but
..net can not because of another different policy?

Chad Z. Hower aka Kudzu дµÀ:
 
C

Chad Z. Hower aka Kudzu

Wayne Wood said:
i mean, you know, there are so many "parameterized properties" and
"optional arguments" in Excel Object Model or so, and i DID deal with
that well in VB.NET, because of its support for these concepts. i
also know there are really some differences between VB.NET and C#, but
after all, they are designed for the same platform, so are you telling
me that something that can be done with VB.NET can not be done with
C#? that's critical, i think i have no time to rewrite the whole code

This is one area that VB is eaiser. VB is looser bound than C# and does many things easier when
working with COM. I nearly exclusively use C#, but when I build COM clients or COM servers
especially I use VB because its much eaiser.
by the way, did you mean COM can support parameterized properties, but
net can not because of another different policy?

Huh?


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
 
W

Wayne Wood

Thanks a lot, i thought they were basically same :)

Chad Z. Hower aka Kudzu дµÀ:
 
W

Wayne Wood

could you please take some for example? i'm so fresh to C# really :)

Chad Z. Hower aka Kudzu дµÀ:
 
C

Chad Z. Hower aka Kudzu

Wayne Wood said:
could you please take some for example? i'm so fresh to C# really :)

Google will turn up huge discussions on this, in fact there was on just a few days ago.

VB: Easier COM support, both using clients and building servers,
Optional arguments

C#: Implicit overloads, operator overloads, using statement, and a few others that esape me right
now.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
http://www.atozed.com/IntraWeb/
 

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

Top