Click here to Skip to main content
15,915,319 members
Home / Discussions / C#
   

C#

 
QuestionDeleting a file from windows service in c# Pin
poqeqw10-Nov-07 4:33
poqeqw10-Nov-07 4:33 
AnswerRe: Deleting a file from windows service in c# Pin
Paul Conrad10-Nov-07 4:35
professionalPaul Conrad10-Nov-07 4:35 
AnswerRe: Deleting a file from windows service in c# Pin
Rajasekharan Vengalil10-Nov-07 6:20
Rajasekharan Vengalil10-Nov-07 6:20 
Questiondatatable sort Pin
Thaer Hamael10-Nov-07 3:05
Thaer Hamael10-Nov-07 3:05 
AnswerRe: datatable sort Pin
pmarfleet10-Nov-07 4:00
pmarfleet10-Nov-07 4:00 
AnswerRe: datatable sort Pin
Guffa10-Nov-07 4:03
Guffa10-Nov-07 4:03 
QuestionStoring references in a List [modified] Pin
rcollina10-Nov-07 2:12
rcollina10-Nov-07 2:12 
AnswerRe: Storing references in a List Pin
Colin Angus Mackay10-Nov-07 3:57
Colin Angus Mackay10-Nov-07 3:57 
Roberto Collina wrote:
Is this a correct way of storing multiple references, or is there a better method you can shed some light on (performance-wise, or just coding-wise)? Is this going to produce GC issues?


A reference just points (or refers) to the actual object. If you store an object reference on two different lists all that is happening is that you now have two places that point (refer) to the same actual object.

It won't cause GC problems. The garbage collector will only remove an object when nothing refers to it any more.

In terms of performance, if you need a list sorted by Z-Order and a list of visible only objects for different purposes then it will probably improve performance. You just need to ensure that the lists are kept up to date an in sync with each other.


Roberto Collina wrote:
I have read about WeakReferences in a reply over these forums but I'm not sure about their usage in this context.


A weak reference is a reference to an object that CAN be garbage collected. In other words you cannot rely on the reference, it may suddenly become null without you realising.

Obviously, if you have something that is a weak reference and you assign it to something then it becomes a stong reference and the garbage collector won't touch it.

Weak references are rarely needed and from the information you've given I don't see why you would need them.


Upcoming FREE developer events:
* Glasgow: SQL Server Managed Objects AND Reporting Services ...

My website

GeneralRe: Storing references in a List Pin
rcollina10-Nov-07 4:34
rcollina10-Nov-07 4:34 
AnswerRe: DataSouce,DisplayMember & ValueMember properties of ComboBox Pin
pmarfleet10-Nov-07 2:11
pmarfleet10-Nov-07 2:11 
QuestionA Question - File Monitoring Pin
gunner_uk200010-Nov-07 0:57
gunner_uk200010-Nov-07 0:57 
AnswerRe: A Question - File Monitoring Pin
Colin Angus Mackay10-Nov-07 1:07
Colin Angus Mackay10-Nov-07 1:07 
QuestionPROBLEM IN SAVING Pin
Sunil Wise10-Nov-07 0:34
professionalSunil Wise10-Nov-07 0:34 
AnswerRe: PROBLEM IN SAVING Pin
Colin Angus Mackay10-Nov-07 0:49
Colin Angus Mackay10-Nov-07 0:49 
GeneralRe: PROBLEM IN SAVING Pin
Sunil Wise10-Nov-07 1:11
professionalSunil Wise10-Nov-07 1:11 
GeneralRe: PROBLEM IN SAVING Pin
Colin Angus Mackay10-Nov-07 1:20
Colin Angus Mackay10-Nov-07 1:20 
GeneralRe: PROBLEM IN SAVING Pin
Paul Conrad10-Nov-07 3:17
professionalPaul Conrad10-Nov-07 3:17 
Questionfilesystem Pin
Sunil Wise9-Nov-07 23:34
professionalSunil Wise9-Nov-07 23:34 
AnswerRe: filesystem Pin
Guffa9-Nov-07 23:54
Guffa9-Nov-07 23:54 
GeneralRe: filesystem Pin
Sunil Wise9-Nov-07 23:59
professionalSunil Wise9-Nov-07 23:59 
QuestionFilling a typed dataset with multiple tables Pin
steve_rm9-Nov-07 22:59
steve_rm9-Nov-07 22:59 
AnswerRe: Filling a typed dataset with multiple tables Pin
Paul Conrad10-Nov-07 4:37
professionalPaul Conrad10-Nov-07 4:37 
QuestionRe: Filling a typed dataset with multiple tables Pin
steve_rm10-Nov-07 6:13
steve_rm10-Nov-07 6:13 
AnswerRe: Filling a typed dataset with multiple tables Pin
Paul Conrad10-Nov-07 6:38
professionalPaul Conrad10-Nov-07 6:38 
QuestionDynamically Printing a bitmap image Pin
sindhutiwari9-Nov-07 22:57
sindhutiwari9-Nov-07 22:57 

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.