PC Review


Reply
Thread Tools Rate Thread

Different access modifier for accessors in a propery

 
 
Romain TAILLANDIER
Guest
Posts: n/a
 
      29th Jul 2004
hi group

I want to do somethng like that :

class MyClass
{
public int _a = 0;
int a
{
public get{return _a;}
protected set{_a = value;}
}
//OR
public int _b = 0;
public int b { get{return _b;} }
protected int b { set{_a = value;} }

}

but it is impossible.
Is there an alternative other than to have two properties with 2 names, or a
SetA(int a); method ?

thanks
ROM


 
Reply With Quote
 
 
 
 
Christian Heide Damm
Guest
Posts: n/a
 
      29th Jul 2004
This will be possible in the .NET 2.0.

Christian

---

"Romain TAILLANDIER" <RomainDotTaillandier_nospam@MaintagDotCom_remove>
wrote in message news:(E-Mail Removed)...
> hi group
>
> I want to do somethng like that :
>
> class MyClass
> {
> public int _a = 0;
> int a
> {
> public get{return _a;}
> protected set{_a = value;}
> }
> //OR
> public int _b = 0;
> public int b { get{return _b;} }
> protected int b { set{_a = value;} }
>
> }
>
> but it is impossible.
> Is there an alternative other than to have two properties with 2 names, or

a
> SetA(int a); method ?
>
> thanks
> ROM
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
default access modifier Tony Microsoft C# .NET 5 29th Feb 2008 02:22 PM
Get Set property - access modifier Eran.Yasso@gmail.com Microsoft C# .NET 11 29th Mar 2007 06:41 PM
Access Modifier Question Doug Microsoft Dot NET 3 24th Oct 2006 05:55 PM
access modifier for webcontrols =?Utf-8?B?YWppdA==?= Microsoft ASP .NET 1 17th Nov 2004 10:03 PM
access modifier ? Ashkan Daie Microsoft VC .NET 1 12th Sep 2003 07:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 PM.