Click here to Skip to main content
15,885,173 members
Home / Discussions / C#
   

C#

 
Generalstore users settings Pin
Member 50926226-Aug-03 23:30
Member 50926226-Aug-03 23:30 
GeneralRe: store users settings Pin
Kannan Kalyanaraman27-Aug-03 1:19
Kannan Kalyanaraman27-Aug-03 1:19 
GeneralRe: store users settings Pin
Member 50926227-Aug-03 10:47
Member 50926227-Aug-03 10:47 
GeneralRe: store users settings Pin
Nick Parker27-Aug-03 6:03
protectorNick Parker27-Aug-03 6:03 
GeneralRe: store users settings Pin
Frank Olorin Rizzi28-Aug-03 1:37
Frank Olorin Rizzi28-Aug-03 1:37 
QuestionHow to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Eric Marchesin26-Aug-03 21:25
Eric Marchesin26-Aug-03 21:25 
AnswerRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Kannan Kalyanaraman27-Aug-03 1:21
Kannan Kalyanaraman27-Aug-03 1:21 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Eric Marchesin27-Aug-03 2:02
Eric Marchesin27-Aug-03 2:02 
Unfortunalely that's not the solution.
Indeed readonly attribute will only forbid to replace the ArrayList object AL by another instance, but one can still do anything with the list. For instance, the following code shows that an item can be added normally : it compiles and no exception is thrown.

public class MyClass
{
	public readonly ArrayList AL = new ArrayList();
}

public class MainClass
{
	static void Main()
	{
		MyClass MC = new MyClass();
		try
		{
			MC.AL.Add("toto");
		}
		catch(Exception e) { MessageBox.Show(e.Message); }
		
		foreach ( object O in MC.AL )
			MessageBox.Show(O.ToString()+" has been added !");
	}
}


What a pity... Sigh | :sigh:

- Éric -
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
leppie27-Aug-03 10:30
leppie27-Aug-03 10:30 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Eric Marchesin27-Aug-03 23:54
Eric Marchesin27-Aug-03 23:54 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
leppie28-Aug-03 6:58
leppie28-Aug-03 6:58 
AnswerRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Meysam Mahfouzi27-Aug-03 1:28
Meysam Mahfouzi27-Aug-03 1:28 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Eric Marchesin28-Aug-03 1:03
Eric Marchesin28-Aug-03 1:03 
AnswerRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Alvaro Mendez27-Aug-03 9:31
Alvaro Mendez27-Aug-03 9:31 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Alvaro Mendez27-Aug-03 10:47
Alvaro Mendez27-Aug-03 10:47 
GeneralRe: How to create a property to get a list on which it'd be impossible to add, replace or remove items ? Pin
Anonymous27-Aug-03 23:52
Anonymous27-Aug-03 23:52 
GeneralC# applect param pass problem Pin
aw1ay26-Aug-03 20:34
aw1ay26-Aug-03 20:34 
GeneralGPRS communication - PocketPC-SmartPhone.. Pin
ZippyBubbleHead26-Aug-03 20:14
ZippyBubbleHead26-Aug-03 20:14 
Generalhelp option... Pin
Member 52474026-Aug-03 20:05
Member 52474026-Aug-03 20:05 
GeneralRe: help option... Pin
Kannan Kalyanaraman27-Aug-03 23:19
Kannan Kalyanaraman27-Aug-03 23:19 
Generalchecking items in a ListView Pin
Member 50926226-Aug-03 20:02
Member 50926226-Aug-03 20:02 
GeneralRe: checking items in a ListView Pin
ZippyBubbleHead26-Aug-03 20:38
ZippyBubbleHead26-Aug-03 20:38 
GeneralRe: checking items in a ListView Pin
Member 50926226-Aug-03 21:55
Member 50926226-Aug-03 21:55 
General#include "wincrypt" Pin
devvvy26-Aug-03 19:06
devvvy26-Aug-03 19:06 
GeneralRe: #include "wincrypt" Pin
David Stone26-Aug-03 19:40
sitebuilderDavid Stone26-Aug-03 19:40 

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.