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

C#

 
GeneralRe: Updating my main form (gui) from another class Pin
ThunorMagi16-Oct-03 18:15
sussThunorMagi16-Oct-03 18:15 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 1:53
eggie517-Oct-03 1:53 
GeneralRe: Updating my main form (gui) from another class Pin
Bo Hunter17-Oct-03 11:32
Bo Hunter17-Oct-03 11:32 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 11:35
eggie517-Oct-03 11:35 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:49
eggie517-Oct-03 13:49 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:52
eggie517-Oct-03 13:52 
GeneralQuestion regarding DictionaryBase Collections class Pin
Subha Sundara16-Oct-03 11:40
Subha Sundara16-Oct-03 11:40 
GeneralRe: Question regarding DictionaryBase Collections class Pin
Jeff Varszegi16-Oct-03 12:01
professionalJeff Varszegi16-Oct-03 12:01 
Okay, I'm not trying to sound stupid, but is there some reason you shouldn't just use an instance of something like Hashtable or StringDictionary directly? I mean, is there something specific you need out of your new class that isn't supported by the built-in collections?

It sounds like you're not going to be modifying the structure during the life of your application. If so, don't make it synchronized, as this will impair performance a little. But if you will be modifying the data, you should synchronize it. With Hashtable, this can be done very easily:

C#
Hashtable hashtable = Hashtable.Synchronized(new Hashtable());


One more tip: if your hashtable will be read very frequently, you should leave a lot of empty space in it, to minimize the chance of an index collision. You can do this by setting the load factor, or by choosing an initial size that's much bigger (say, double or more) than
the number of expected entries. This should be a really miniscule memory whack, since your object will be shared by the whole application.

You might want to also play around with ADO.NET's caching features. One of the coolest features of .NET is the ability to basically keep an in-memory database, searchable and all. I don't think your problem calls for this, though.


Regards,

Jeff Varszegi
GeneralGDI+ question Pin
16-Oct-03 6:22
suss16-Oct-03 6:22 
GeneralRe: GDI+ question Pin
Heath Stewart16-Oct-03 8:41
protectorHeath Stewart16-Oct-03 8:41 
GeneralRe: GDI+ question Pin
sacoskun18-Oct-03 20:23
sacoskun18-Oct-03 20:23 
QuestionIs it possible to catch SystemEvent in Windows service? Pin
EnkelIk16-Oct-03 5:09
EnkelIk16-Oct-03 5:09 
AnswerRe: Is it possible to catch SystemEvent in Windows service? Pin
ankita patel16-Oct-03 12:22
ankita patel16-Oct-03 12:22 
GeneralC# -> Remoting and MarshalByValue Pin
Alsvha16-Oct-03 3:36
Alsvha16-Oct-03 3:36 
GeneralRe: C# -> Remoting and MarshalByValue Pin
Guillermo Rivero16-Oct-03 7:59
Guillermo Rivero16-Oct-03 7:59 
GeneralRe: C# -> Remoting and MarshalByValue Pin
Alsvha16-Oct-03 19:12
Alsvha16-Oct-03 19:12 
GeneralRe: C# -> Remoting and MarshalByValue Pin
Guillermo Rivero17-Oct-03 3:24
Guillermo Rivero17-Oct-03 3:24 
Generalapp.config / web.config Pin
Colin Angus Mackay16-Oct-03 2:36
Colin Angus Mackay16-Oct-03 2:36 
GeneralRe: app.config / web.config Pin
Ranjan Banerji16-Oct-03 4:23
Ranjan Banerji16-Oct-03 4:23 
GeneralListviews - Accessing SelectedItemArray Pin
MrEyes16-Oct-03 0:38
MrEyes16-Oct-03 0:38 
GeneralRe: Listviews - Accessing SelectedItemArray Pin
Mike Dimmick16-Oct-03 5:24
Mike Dimmick16-Oct-03 5:24 
GeneralRe: Listviews - Accessing SelectedItemArray Pin
Darryl Borden17-Oct-03 3:32
Darryl Borden17-Oct-03 3:32 
General2 different programing languages in one piece of code Pin
zukhanye15-Oct-03 23:10
zukhanye15-Oct-03 23:10 
GeneralRe: 2 different programing languages in one piece of code Pin
Heath Stewart16-Oct-03 9:04
protectorHeath Stewart16-Oct-03 9:04 
GeneralProblem with Mdi forms Pin
CristianRicciolo15-Oct-03 23:05
CristianRicciolo15-Oct-03 23: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.