Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

C# Property Accessibility


I have a property block in this class here, and I want it to be get / set,
but the set should only be visible to the system.  i.e., a user application
that uses this library should not be able to set the property.  It should be
read only to the outside world, but read / write for my infrastructure.

I'm having trouble phrasing the code.

--

Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei

"Mike Labosh" <mlabosh_at_hotmail_dot_com> wrote in message

news:uWjTcNdUHHA.4744@TK2MSFTNGP02.phx.gbl...

>I have a property block in this class here, and I want it to be get / set,
> but the set should only be visible to the system.  i.e., a user
> application
> that uses this library should not be able to set the property.  It should
> be
> read only to the outside world, but read / write for my infrastructure.

> I'm having trouble phrasing the code.

You mix accessibility like:

public int MyInt {
get {....}
internal set { ...}

}

Believe this is a .Net 2.0 feature only.

PS

> You mix accessibility like:

> public int MyInt {
> get {....}
> internal set { ...}
> }

THAT'S COOL!  I would never have thought of trying that.  THANKS!

--

Peace & happy computing,

Mike Labosh, MCSD MCT
Owner, vbSensei.Com

"Escriba coda ergo sum." -- vbSensei

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc