Click here to Skip to main content
15,905,683 members
Home / Discussions / C#
   

C#

 
GeneralRe: Argument Pin
CPallini28-Apr-09 1:56
mveCPallini28-Apr-09 1:56 
GeneralRe: Argument Pin
musefan28-Apr-09 2:06
musefan28-Apr-09 2:06 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:05
BabyOreo27-Apr-09 23:05 
GeneralRe: Argument Pin
musefan27-Apr-09 23:47
musefan27-Apr-09 23:47 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:52
BabyOreo27-Apr-09 23:52 
GeneralRe: Argument Pin
musefan28-Apr-09 0:45
musefan28-Apr-09 0:45 
AnswerRe: Argument Pin
SeMartens27-Apr-09 22:08
SeMartens27-Apr-09 22:08 
AnswerRe: Argument Pin
N a v a n e e t h27-Apr-09 22:35
N a v a n e e t h27-Apr-09 22:35 
shennwooi wrote:
Can i assign some string or integer to EventArgs?


NO.

If there is a good reason for doing this, create your own class which derives from EventArgs. Use implicit operator. Eg:
class MyEventArgs : EventArgs
{
    string name;
    public string Name { get { return name; } }

    public MyEventArgs(string name)
    {
        this.name = name;
    }

    public static implicit operator MyEventArgs(string str)
    {
        return new MyEventArgs(str);
    }
}

class Program
{
    static void Main(string[] args)
    {
        MyEventArgs ar = "hello";
        Console.WriteLine(ar.Name);
    }
}
Smile | :)


AnswerRe: Argument Pin
12Code27-Apr-09 23:07
12Code27-Apr-09 23:07 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:13
BabyOreo27-Apr-09 23:13 
GeneralRe: Argument Pin
Luc Pattyn28-Apr-09 1:10
sitebuilderLuc Pattyn28-Apr-09 1:10 
AnswerRe: Argument [modified] Pin
DaveyM6927-Apr-09 23:13
professionalDaveyM6927-Apr-09 23:13 
QuestionSomething with a delegate Pin
Joramq27-Apr-09 21:51
Joramq27-Apr-09 21:51 
AnswerRe: Something with a delegate Pin
Christian Graus27-Apr-09 22:07
protectorChristian Graus27-Apr-09 22:07 
GeneralRe: Something with a delegate Pin
Joramq27-Apr-09 22:10
Joramq27-Apr-09 22:10 
AnswerRe: Something with a delegate Pin
OriginalGriff27-Apr-09 22:10
mveOriginalGriff27-Apr-09 22:10 
AnswerRe: Something with a delegate Pin
N a v a n e e t h27-Apr-09 22:38
N a v a n e e t h27-Apr-09 22:38 
GeneralRe: Something with a delegate Pin
Joramq27-Apr-09 23:09
Joramq27-Apr-09 23:09 
GeneralRe: Something with a delegate Pin
N a v a n e e t h28-Apr-09 0:09
N a v a n e e t h28-Apr-09 0:09 
GeneralRe: Something with a delegate Pin
Joramq28-Apr-09 0:17
Joramq28-Apr-09 0:17 
GeneralRe: Something with a delegate Pin
Tom Deketelaere28-Apr-09 1:20
professionalTom Deketelaere28-Apr-09 1:20 
GeneralRe: Something with a delegate Pin
N a v a n e e t h28-Apr-09 1:59
N a v a n e e t h28-Apr-09 1:59 
AnswerRe: Something with a delegate Pin
Luc Pattyn28-Apr-09 1:17
sitebuilderLuc Pattyn28-Apr-09 1:17 
GeneralRe: Something with a delegate Pin
Joramq28-Apr-09 2:03
Joramq28-Apr-09 2:03 
Questionhow can i send mail to all the members at a once...database contains the user details and email addresses........ Pin
jiya131127-Apr-09 21:10
jiya131127-Apr-09 21:10 

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.