Click here to Skip to main content
15,918,268 members
Home / Discussions / C#
   

C#

 
GeneralRe: change form title (text) base on application Pin
donkaiser9-Jun-06 5:20
donkaiser9-Jun-06 5:20 
QuestionDesign question Pin
Elina Blank9-Jun-06 4:52
sitebuilderElina Blank9-Jun-06 4:52 
AnswerRe: Design question Pin
LongRange.Shooter9-Jun-06 7:01
LongRange.Shooter9-Jun-06 7:01 
AnswerRe: Design question Pin
nevezuxa9-Jun-06 8:09
nevezuxa9-Jun-06 8:09 
AnswerRe: Design question Pin
BoneSoft9-Jun-06 11:32
BoneSoft9-Jun-06 11:32 
QuestionHow to remotely change system setting [modified] Pin
bannapradeep9-Jun-06 4:25
bannapradeep9-Jun-06 4:25 
QuestionLock on static object - Threading Question (long) [modified] Pin
Alexander Wiseman9-Jun-06 4:14
Alexander Wiseman9-Jun-06 4:14 
AnswerRe: Lock on static object - Threading Question (long) Pin
Dustin Metzgar9-Jun-06 5:09
Dustin Metzgar9-Jun-06 5:09 
I don't see anything wrong with what you're doing. You use the property correctly by locking access to your field strToProtect. The lock object should be static if the field you're trying to lock is also static, but your field is an instance variable. And your thread function doesn't need to be static. It's not bad practice, it's just depends on what your requirements demand. As an instance method, that method will have access to the particular instance of MyClass.

If you want any of these things to be static, you should make them all static: the field, the lock object, and the thread method.

HTH

GeneralRe: Lock on static object - Threading Question (long) Pin
Alexander Wiseman9-Jun-06 5:14
Alexander Wiseman9-Jun-06 5:14 
AnswerRe: Lock on static object - Threading Question (long) Pin
LongRange.Shooter9-Jun-06 7:16
LongRange.Shooter9-Jun-06 7:16 
GeneralRe: Lock on static object - Threading Question (long) Pin
Alexander Wiseman9-Jun-06 7:37
Alexander Wiseman9-Jun-06 7:37 
Questionvalidate input Pin
donkaiser9-Jun-06 4:03
donkaiser9-Jun-06 4:03 
AnswerRe: validate input Pin
Dustin Metzgar9-Jun-06 4:24
Dustin Metzgar9-Jun-06 4:24 
GeneralRe: validate input Pin
donkaiser9-Jun-06 4:35
donkaiser9-Jun-06 4:35 
GeneralRe: validate input Pin
Dustin Metzgar9-Jun-06 4:51
Dustin Metzgar9-Jun-06 4:51 
AnswerRe: validate input Pin
Josh Smith9-Jun-06 4:24
Josh Smith9-Jun-06 4:24 
GeneralRe: validate input Pin
donkaiser9-Jun-06 4:40
donkaiser9-Jun-06 4:40 
GeneralRe: validate input Pin
Josh Smith9-Jun-06 5:15
Josh Smith9-Jun-06 5:15 
QuestionHow to run App from stream ? Pin
hdv2129-Jun-06 3:20
hdv2129-Jun-06 3:20 
AnswerRe: How to run App from stream ? Pin
Josh Smith9-Jun-06 4:00
Josh Smith9-Jun-06 4:00 
Questionsearch in combobox Pin
Mohammed Elkholy9-Jun-06 2:09
Mohammed Elkholy9-Jun-06 2:09 
AnswerRe: search in combobox Pin
Michael Potter9-Jun-06 6:16
Michael Potter9-Jun-06 6:16 
AnswerRe: search in combobox Pin
Drew McGhie9-Jun-06 8:36
Drew McGhie9-Jun-06 8:36 
GeneralRe: search in combobox Pin
Mohammed Elkholy11-Jun-06 8:21
Mohammed Elkholy11-Jun-06 8:21 
QuestionActive Directory [modified] Pin
pooja_a289-Jun-06 1:19
pooja_a289-Jun-06 1:19 

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.