Click here to Skip to main content
15,914,225 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Very simple combobox trouble Pin
Luc Pattyn23-Feb-10 11:26
sitebuilderLuc Pattyn23-Feb-10 11:26 
GeneralRe: Very simple combobox trouble Pin
Nikz223-Feb-10 12:10
Nikz223-Feb-10 12:10 
QuestionSave application state and reload it at restart Pin
adoerig22-Feb-10 2:31
adoerig22-Feb-10 2:31 
AnswerRe: Save application state and reload it at restart Pin
Dimitri Witkowski22-Feb-10 3:15
Dimitri Witkowski22-Feb-10 3:15 
AnswerRe: Save application state and reload it at restart Pin
Not Active22-Feb-10 3:18
mentorNot Active22-Feb-10 3:18 
AnswerRe: Save application state and reload it at restart Pin
Dave Kreskowiak22-Feb-10 3:35
mveDave Kreskowiak22-Feb-10 3:35 
AnswerRe: Save application state and reload it at restart Pin
Eddy Vluggen23-Feb-10 7:17
professionalEddy Vluggen23-Feb-10 7:17 
AnswerRe: Save application state and reload it at restart Pin
jimclack26-Feb-10 9:55
jimclack26-Feb-10 9:55 
I had the same problem a couple of years ago. It is really quite easy to do. Three steps:

1. Make sure that everything in your app is in a serializable hierarchy. This typically IS the case - your application is at the top of the hierarchy.
2. Make all handle-based references (files, streams, etc.) weak references. They should always check before they are used to see if they are null, then reopen if so.
3. Write that top element (the application) out to an Object stream. Then you can read that object stream back in to restore the session.

Number 1 above introduces a few twists. There are always certain values that you do not want to red back in. For instance: the aforementioned file handles/streams, current time, is something in an error state? For those values, make sure they are initialized and set them to non serializable.

It works well and it's fairly easy
GeneralSMS HELP Pin
mbadi20-Feb-10 8:50
mbadi20-Feb-10 8:50 
GeneralRe: SMS HELP Pin
Abhinav S20-Feb-10 13:45
Abhinav S20-Feb-10 13:45 
GeneralRe: SMS HELP Pin
Bharat Jain25-Feb-10 2:35
Bharat Jain25-Feb-10 2:35 
QuestionEdit mode in oledb connection Pin
akosidandan20-Feb-10 4:47
akosidandan20-Feb-10 4:47 
AnswerRe: Edit mode in oledb connection Pin
Not Active20-Feb-10 5:05
mentorNot Active20-Feb-10 5:05 
GeneralRe: Edit mode in oledb connection Pin
akosidandan20-Feb-10 5:11
akosidandan20-Feb-10 5:11 
GeneralRe: Edit mode in oledb connection Pin
Not Active20-Feb-10 6:54
mentorNot Active20-Feb-10 6:54 
GeneralRe: Edit mode in oledb connection Pin
Nandan Basak20-Feb-10 9:10
Nandan Basak20-Feb-10 9:10 
GeneralRe: Edit mode in oledb connection Pin
Not Active20-Feb-10 9:41
mentorNot Active20-Feb-10 9:41 
QuestionOpen source ide Pin
srikantha_nagaraj20-Feb-10 0:43
srikantha_nagaraj20-Feb-10 0:43 
AnswerRe: Open source ide Pin
Eddy Vluggen20-Feb-10 0:53
professionalEddy Vluggen20-Feb-10 0:53 
GeneralRe: Open source ide Pin
thatraja20-Feb-10 3:41
professionalthatraja20-Feb-10 3:41 
GeneralRe: Open source ide Pin
Kevin McFarlane20-Feb-10 5:15
Kevin McFarlane20-Feb-10 5:15 
Questionreading a file from a remote computer using UNC in C# console app. Pin
thivya n19-Feb-10 6:02
thivya n19-Feb-10 6:02 
AnswerRe: reading a file from a remote computer using UNC in C# console app. Pin
The Man from U.N.C.L.E.19-Feb-10 6:29
The Man from U.N.C.L.E.19-Feb-10 6:29 
GeneralRe: reading a file from a remote computer using UNC in C# console app. Pin
thivya n1-Mar-10 1:16
thivya n1-Mar-10 1:16 
QuestionCan someone help me with 2 Forms Pin
Bob Beaubien19-Feb-10 4:58
Bob Beaubien19-Feb-10 4:58 

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.