Click here to Skip to main content
15,906,625 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting numbers Pin
Scott Dorman28-Aug-07 7:10
professionalScott Dorman28-Aug-07 7:10 
GeneralRe: Converting numbers Pin
Le centriste28-Aug-07 7:14
Le centriste28-Aug-07 7:14 
GeneralRe: Converting numbers Pin
Scott Dorman28-Aug-07 7:23
professionalScott Dorman28-Aug-07 7:23 
GeneralRe: Converting numbers Pin
DavidNohejl29-Aug-07 1:01
DavidNohejl29-Aug-07 1:01 
QuestionIcons in ListBox Pin
spotl28-Aug-07 6:46
spotl28-Aug-07 6:46 
AnswerRe: Icons in ListBox Pin
Scott Dorman28-Aug-07 7:06
professionalScott Dorman28-Aug-07 7:06 
AnswerRe: Icons in ListBox Pin
I Believe In GOD28-Aug-07 7:20
I Believe In GOD28-Aug-07 7:20 
QuestionSet readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 6:26
Paw Jershauge28-Aug-07 6:26 
AnswerRe: Set readonly attribute of an class property at runtime Pin
J4amieC28-Aug-07 6:42
J4amieC28-Aug-07 6:42 
GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 10:12
Paw Jershauge28-Aug-07 10:12 
GeneralRe: Set readonly attribute of an class property at runtime Pin
led mike28-Aug-07 11:04
led mike28-Aug-07 11:04 
GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 20:27
Paw Jershauge28-Aug-07 20:27 
AnswerRe: Set readonly attribute of an class property at runtime Pin
led mike28-Aug-07 7:21
led mike28-Aug-07 7:21 
PawJershauge wrote:
Does anyone know how to set the readonly attribute of an class property at runtime.


Is this a trick question?

public class Myclass
{
	private int x = 0;
	private int y = 0;


	[ReadOnly(true), Description("Set X value")]
	public int X
	{
		get { return x; }
		set { x = value; }
	}

	[ReadOnly(false), Description("Set Y value")]
	public int Y
	{
		get { return y; }
		set { y = value; }
	}
}


Myclass mc = new Myclass();
mc.X = 10;
Debug.WriteLine(String.Format("Myclass.X: {0}", mc.X));



GeneralRe: Set readonly attribute of an class property at runtime Pin
Paw Jershauge28-Aug-07 10:15
Paw Jershauge28-Aug-07 10:15 
QuestionControl is locked, how to unlock? [modified] Pin
Jordanwb28-Aug-07 5:54
Jordanwb28-Aug-07 5:54 
AnswerRe: Control is locked, how to unlock? Pin
Guffa28-Aug-07 6:25
Guffa28-Aug-07 6:25 
GeneralRe: Control is locked, how to unlock? [modified] Pin
Jordanwb28-Aug-07 14:53
Jordanwb28-Aug-07 14:53 
GeneralRe: Control is locked, how to unlock? Pin
Guffa28-Aug-07 21:03
Guffa28-Aug-07 21:03 
GeneralRe: Control is locked, how to unlock? Pin
Jordanwb29-Aug-07 7:43
Jordanwb29-Aug-07 7:43 
AnswerRe: Control is locked, how to unlock? Pin
Guffa29-Aug-07 11:59
Guffa29-Aug-07 11:59 
QuestionRandom Number Pin
Imran Adam28-Aug-07 5:34
Imran Adam28-Aug-07 5:34 
AnswerRe: Random Number [modified] Pin
Alaric_28-Aug-07 6:05
professionalAlaric_28-Aug-07 6:05 
AnswerRe: Random Number Pin
originSH28-Aug-07 6:10
originSH28-Aug-07 6:10 
GeneralRe: Random Number Pin
Yitzchok Dev28-Aug-07 10:40
Yitzchok Dev28-Aug-07 10:40 
GeneralRe: Random Number Pin
Guffa28-Aug-07 21:05
Guffa28-Aug-07 21:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.