Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200416-May-08 6:03
asafbs200416-May-08 6:03 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult16-May-08 9:38
mvePIEBALDconsult16-May-08 9:38 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200416-May-08 12:17
asafbs200416-May-08 12:17 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult16-May-08 18:28
mvePIEBALDconsult16-May-08 18:28 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200417-May-08 0:18
asafbs200417-May-08 0:18 
AnswerRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult17-May-08 7:12
mvePIEBALDconsult17-May-08 7:12 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200417-May-08 7:59
asafbs200417-May-08 7:59 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult17-May-08 8:28
mvePIEBALDconsult17-May-08 8:28 
OK, here's a method:

public static class Runner
{
    public static void
    RunThis
    (
        System.Threading.ParameterizedThreadStart What
    ,
        object                                    Parameter
    )
    {
        (new System.Threading.Thread ( What )).Start ( Parameter ) ;
    }
}


But, as you can see, all it does is wrap one statement, so it's hardly worth the trouble.


Here's a method it can execute (yours won't be static):

private static void
Hello
(
    object Who
)
{
    System.Console.WriteLine ( "Hello, {0}!" , Who ) ;
}



Executing it is as simple as:

RunThis ( new System.Threading.ParameterizedThreadStart ( Hello ) , "world" ) ;
 
or
 
(new System.Threading.Thread ( new System.Threading.ParameterizedThreadStart ( Hello ) )).Start ( "world" ) ;


I hope you can see that the RunThis method doesn't reduce the complexity of the calling method very much.

But hold on, I'll go work on a non-static version...
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult17-May-08 9:02
mvePIEBALDconsult17-May-08 9:02 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200417-May-08 12:34
asafbs200417-May-08 12:34 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
asafbs200417-May-08 12:50
asafbs200417-May-08 12:50 
GeneralRe: Debug error " 'Method' is a 'variable' but is used like a 'method'" Pin
PIEBALDconsult17-May-08 13:59
mvePIEBALDconsult17-May-08 13:59 
QuestionDifference between an EXE and DLL Pin
jdkulkarni16-May-08 3:31
jdkulkarni16-May-08 3:31 
AnswerRe: Difference between an EXE and DLL Pin
originSH16-May-08 3:48
originSH16-May-08 3:48 
AnswerRe: Difference between an EXE and DLL Pin
Brady Kelly16-May-08 3:53
Brady Kelly16-May-08 3:53 
QuestionError in buliding installer? Pin
Ibuprofen16-May-08 2:48
Ibuprofen16-May-08 2:48 
QuestionUrgent : Save/Cancel popup Pin
rockz...16-May-08 2:25
rockz...16-May-08 2:25 
AnswerRe: Urgent : Save/Cancel popup Pin
Christian Graus16-May-08 2:27
protectorChristian Graus16-May-08 2:27 
GeneralRe: Urgent : Save/Cancel popup Pin
Christian Wikander16-May-08 2:31
Christian Wikander16-May-08 2:31 
Questionthread safety in ManualResetEvent Pin
George_George16-May-08 2:13
George_George16-May-08 2:13 
AnswerRe: thread safety in ManualResetEvent Pin
N a v a n e e t h16-May-08 2:47
N a v a n e e t h16-May-08 2:47 
GeneralRe: thread safety in ManualResetEvent Pin
George_George16-May-08 3:02
George_George16-May-08 3:02 
AnswerRe: thread safety in ManualResetEvent Pin
carbon_golem16-May-08 3:56
carbon_golem16-May-08 3:56 
GeneralRe: thread safety in ManualResetEvent Pin
George_George16-May-08 4:43
George_George16-May-08 4:43 
GeneralRe: thread safety in ManualResetEvent Pin
led mike16-May-08 4:52
led mike16-May-08 4:52 

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.