get_ & set_

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Newbie Proble

I have created one project, that I am now referencing in an other. In the new project I seem to be seeing properties of classes as get_Amount and set_Amount

Which is aweful to write code quickly to, for the quickinfo dropdown then becomes useless, for you simple want to select Amount

Is this a "feature" or a bug that is in the ide

Regards
ACG
 
I may be answering the wrong question, but all properties in C# and VB.NET
are actually implemented as methods named get_XXX and set_XXX, with some
metadata markup added to the assembly (this plumbing is more obvious exposed
in MC++ and J#). There are several CLS rules that govern property interop,
and both VB and C# are hardwired to follow the CLS when creating their
properties. So are you not able to call the properties directly? Or is it
just a problem with Intellisense? What version of Visual Studio are you
running?
--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com



ACG said:
Newbie Problem

I have created one project, that I am now referencing in an other. In the
new project I seem to be seeing properties of classes as get_Amount and
set_Amount.
Which is aweful to write code quickly to, for the quickinfo dropdown then
becomes useless, for you simple want to select Amount.
 
I hope I can convey this well. When setting/getting a property of a class inside its own project, I get

foo.Amoun

When I use intellisense in another project that has a reference to the other projects' class library, I get

foo.get_Amoun

foo.set_Amoun

I would love to have just foo.Amount. Is this a studio 2003 problem

Regards
Ada
 
So is it just an Intellisense problem, or do you actually get a compiler
error with foo.Amount from the second project?

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com


ACG said:
I hope I can convey this well. When setting/getting a property of a class inside its own project, I get:

foo.Amount

When I use intellisense in another project that has a reference to the
other projects' class library, I get:
 
<off topic>

Hey Mickey,

I just wanted to thank you for a great book. Yours was one of the first
I bought when I made the switch from VB6 to C# and I've been using it
ever since. Keep up the good work.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
Cool, thanks for that.
I'm currently planning the update and building sample code, so feel free to
drop me a note if there are any topics that you'd like to see included (or
changed) in the Whidbey version of the book. My email address is [my first
name] at servergeek dot com.
 
Back
Top