Click here to Skip to main content
15,886,724 members
Home / Discussions / C#
   

C#

 
AnswerRe: convert .xls file into image file or word image file Pin
Wes Aday22-Oct-09 4:06
professionalWes Aday22-Oct-09 4:06 
AnswerRe: convert .xls file into image file or word image file Pin
benjymous22-Oct-09 5:03
benjymous22-Oct-09 5:03 
Questionhaving problem in opening Ms Office files into webBrowser Pin
muhammad_umair22-Oct-09 1:08
muhammad_umair22-Oct-09 1:08 
AnswerRe: having problem in opening Ms Office files into webBrowser Pin
Richard MacCutchan22-Oct-09 1:50
mveRichard MacCutchan22-Oct-09 1:50 
QuestionUsing lock statement inside overloaded methods Pin
Nuno Pacheco22-Oct-09 0:19
Nuno Pacheco22-Oct-09 0:19 
AnswerRe: Using lock statement inside overloaded methods Pin
Covean22-Oct-09 1:12
Covean22-Oct-09 1:12 
GeneralRe: Using lock statement inside overloaded methods Pin
Nuno Pacheco22-Oct-09 1:23
Nuno Pacheco22-Oct-09 1:23 
GeneralRe: Using lock statement inside overloaded methods Pin
Covean22-Oct-09 1:48
Covean22-Oct-09 1:48 
At first I think, to implement a the basis of little modules/classes, is a better
way to solve problems.
Classes are in general more flexible through inheritance, access rights etc.

Example:

public class MultiThreadingClass
{
    public MultiThreadingClass()
    {
    }

    private object m_objSync = new object();
    private int m_nValueA = 0; 
    private int m_szText = string.Empty;

    public SyncObj
    {
        get 
        { 
            return m_objSync;
        }
    }

    public Value
    {
        get 
        {
            lock(objSync)
            {
                return m_nValue;
            }
        }
        set
        {
            lock(objSync)
            {
                m_nValue = value;
            }
        }
    }

    public Text
    {
        get 
        {
            lock(objSync)
            {
                return m_szText;
            }
        }
        set
        {
            lock(objSync)
            {
                m_szText = value;
            }
        }
    }
}


Thats not the best way to implement it, but out of this class you can be sure of the values (thread-safe). And if you need extern sync you just have to call lock([classInstance].SyncObj);
One more profit is, that you can have more than one instance of this class.

I hope I could explain you a little bit what I meant.
GeneralRe: Using lock statement inside overloaded methods Pin
Nuno Pacheco22-Oct-09 2:36
Nuno Pacheco22-Oct-09 2:36 
GeneralRe: Using lock statement inside overloaded methods Pin
Covean22-Oct-09 2:53
Covean22-Oct-09 2:53 
Questionhow to create multiple connections in a client application Pin
Ajithevn21-Oct-09 23:36
Ajithevn21-Oct-09 23:36 
QuestionRe: how to create multiple connections in a client application Pin
Björn T.J.M. Spruit22-Oct-09 0:00
Björn T.J.M. Spruit22-Oct-09 0:00 
AnswerRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:11
Ajithevn22-Oct-09 0:11 
AnswerRe: how to create multiple connections in a client application Pin
Abhishek Sur22-Oct-09 0:07
professionalAbhishek Sur22-Oct-09 0:07 
GeneralRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 0:17
Ajithevn22-Oct-09 0:17 
QuestionRe: how to create multiple connections in a client application Pin
Ajithevn22-Oct-09 1:04
Ajithevn22-Oct-09 1:04 
QuestionText blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit21-Oct-09 23:04
Björn T.J.M. Spruit21-Oct-09 23:04 
AnswerRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 1:54
Björn T.J.M. Spruit22-Oct-09 1:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 2:15
Covean22-Oct-09 2:15 
GeneralRe: Text blurring using Graphics.Drawstring [modified] Pin
Björn T.J.M. Spruit22-Oct-09 2:54
Björn T.J.M. Spruit22-Oct-09 2:54 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Covean22-Oct-09 3:18
Covean22-Oct-09 3:18 
GeneralRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit22-Oct-09 3:27
Björn T.J.M. Spruit22-Oct-09 3:27 
NewsRe: Text blurring using Graphics.Drawstring Pin
Björn T.J.M. Spruit30-Oct-09 4:25
Björn T.J.M. Spruit30-Oct-09 4:25 
GeneralRe: Text blurring using Graphics.Drawstring Pin
User 680178026-Feb-10 8:05
User 680178026-Feb-10 8:05 
QuestionHow to pass any text value from form to Crystal Report ? Pin
E_Gold21-Oct-09 22:53
E_Gold21-Oct-09 22:53 

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.