Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to friend properties

Status
Not open for further replies.

phinoppix

Programmer
Jul 24, 2002
437
US
With VB...
[tt]
Public Property Get ID() as long
...
End Property

Friend Property Let ID(Byval vData as Long)
...
End Property
[/tt]

Property ID() is public to other projects as read-only; R/W within the project DLL. How do I code this with C#?
(Note: What I'm trying to achieve is to be able to access ID() using the convention obj.ID() whether it be in the project DLL and esp on other projects.)

Played around with internal but no luck. (Though I ended up w/ a "pair" of
[tt]
// exposed to other projects
public int ID
{ get{return m_ID;} }

// visible only in dll project
internal void SetID(int newID)
{ m_ID = newID; }
[/tt]

for immediate remedy. Only if there is a way to make the set statement internal)

Hope I explained well my qry. TIA [peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top