Click here to Skip to main content
16,005,473 members
Home / Discussions / C#
   

C#

 
GeneralRe: singelton problem Pin
Luc Pattyn10-Jun-07 7:23
sitebuilderLuc Pattyn10-Jun-07 7:23 
GeneralRe: singelton problem Pin
akkram10-Jun-07 7:47
akkram10-Jun-07 7:47 
GeneralRe: singelton problem Pin
Luc Pattyn10-Jun-07 8:17
sitebuilderLuc Pattyn10-Jun-07 8:17 
AnswerRe: singelton problem Pin
Guffa10-Jun-07 7:43
Guffa10-Jun-07 7:43 
AnswerRe: singelton problem Pin
Muammar©10-Jun-07 8:46
Muammar©10-Jun-07 8:46 
GeneralRe: singelton problem Pin
Luc Pattyn10-Jun-07 8:49
sitebuilderLuc Pattyn10-Jun-07 8:49 
GeneralRe: singelton problem Pin
akkram10-Jun-07 23:35
akkram10-Jun-07 23:35 
GeneralRe: singelton problem [modified] Pin
Alaric_11-Jun-07 5:27
professionalAlaric_11-Jun-07 5:27 
I believe checking form2.IsDisposed will create the functionality that you are looking for, but from reading this thread, it seems like you are inappropriately applying the Singleton pattern if you are needing to perform this check. You might want to read up on your Singleton & Other GoF patterns[^] The Singleton is not really intended for flow control between forms unless it is necessary that (for some reason) you require the EXACT SAME instance of the form throughout the entire application process.(Singletons are more appropriately applied(for example) to concurrent invocation of a state machine on a remote server....or for the Load Balancing example given at the link I included above) Unless you have a very good reason for doing this, then using a Singleton convolutes your logic, and should be avoided. If you are simply wanting to restrict your user to only maintaining one instance of the form at any one time, then you could simply disable the ability to create a separate instance as was demonstrated in previous replies
Allow user to instantiate a new form(You're probably wanting it to be Modal)
Restrict user from instantiating a second instance of the form
User invokes some business logic on the form
User closes form when finished

If the user wants to replicate the process(let's say...the form allows the user to perform some calculation based upon values selected in an UltraWebGrid), the process would be repeated.

Welcome my son...Welcome..to the Machine

QuestionSearch.asp.cs in C# Pin
haibec10-Jun-07 5:27
haibec10-Jun-07 5:27 
AnswerRe: Search.asp.cs in C# Pin
Colin Angus Mackay10-Jun-07 6:00
Colin Angus Mackay10-Jun-07 6:00 
GeneralRe: Search.asp.cs in C# Pin
haibec10-Jun-07 6:07
haibec10-Jun-07 6:07 
GeneralRe: Search.asp.cs in C# Pin
Colin Angus Mackay10-Jun-07 11:18
Colin Angus Mackay10-Jun-07 11:18 
AnswerRe: Search.asp.cs in C# Pin
Christian Graus10-Jun-07 13:14
protectorChristian Graus10-Jun-07 13:14 
GeneralRe: Search.asp.cs in C# Pin
haibec10-Jun-07 13:23
haibec10-Jun-07 13:23 
GeneralRe: Search.asp.cs in C# Pin
Christian Graus10-Jun-07 14:36
protectorChristian Graus10-Jun-07 14:36 
QuestionDataGridViewCheckBoxColumn on-click Event Pin
dbetting10-Jun-07 4:52
dbetting10-Jun-07 4:52 
QuestionChange typing language Pin
clint198210-Jun-07 4:50
clint198210-Jun-07 4:50 
AnswerRe: Change typing language Pin
Colin Angus Mackay10-Jun-07 6:02
Colin Angus Mackay10-Jun-07 6:02 
QuestionRe: Change typing language Pin
clint198210-Jun-07 11:59
clint198210-Jun-07 11:59 
AnswerRe: Change typing language Pin
Colin Angus Mackay10-Jun-07 13:19
Colin Angus Mackay10-Jun-07 13:19 
QuestionEncoding in .DBF file. Pin
tg200410-Jun-07 1:59
tg200410-Jun-07 1:59 
AnswerRe: Encoding in .DBF file. Pin
Guffa10-Jun-07 4:33
Guffa10-Jun-07 4:33 
GeneralRe: Encoding in .DBF file. Pin
tg200412-Jun-07 7:15
tg200412-Jun-07 7:15 
AnswerRe: Encoding in .DBF file. Pin
Guffa12-Jun-07 8:17
Guffa12-Jun-07 8:17 
QuestionHow to set SelectionFont when it returns null? Pin
rvp717y10-Jun-07 1:55
rvp717y10-Jun-07 1:55 

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.