Click here to Skip to main content
15,910,083 members
Home / Discussions / C#
   

C#

 
QuestionRepeated code with little difference Pin
Xenoserv21-May-09 12:09
Xenoserv21-May-09 12:09 
AnswerRe: Repeated code with little difference Pin
Luc Pattyn21-May-09 12:46
sitebuilderLuc Pattyn21-May-09 12:46 
AnswerRe: Repeated code with little difference Pin
_Maxxx_21-May-09 17:30
professional_Maxxx_21-May-09 17:30 
QuestionSleek looking window application Pin
humayunlalzad21-May-09 12:09
humayunlalzad21-May-09 12:09 
AnswerRe: Sleek looking window application Pin
EliottA21-May-09 12:37
EliottA21-May-09 12:37 
AnswerRe: Sleek looking window application Pin
_Maxxx_21-May-09 17:32
professional_Maxxx_21-May-09 17:32 
GeneralRe: Sleek looking window application Pin
humayunlalzad22-May-09 5:21
humayunlalzad22-May-09 5:21 
QuestionHow to get custom attributes from a function called by delegate? [modified] Pin
Anindya Chatterjee21-May-09 11:24
Anindya Chatterjee21-May-09 11:24 
suppose I have 3 functions.

1.
[CustomAttrib("First")]
public int Foo1(ref int x, out float y, SomeDelegate callback)

2.
[CustomAttrib("Second")]
public Stream Foo2(string name, SomeEnum enums);

3.
[CustomAttrib("Third')]
public void Foo3(string message, out double count, SomeStruct str);

Now what I want to do, is to validate each function according to their attribute. I want to create only one function named Validate which will validate all the above functions and then call them.

I tried to use delegate, lambda expression in Validate to pass the function, but nothing can get the attribute data.

I already tried :

public object Validate(Func<object> method) { .... } and call it as

Validate(() => Foo1(ref x, out y, DoCallBack));

or

public object Validate(Delegate method) { .... } & call it as

Validate(delegate() {return Foo2(null, SomeEnum.EnumValue); };

but none of them can get the attribute information of the called function
[Foo1, Foo2 etc.] in the body of Validate function.

Can anybody please suggest me any way-around to accomplish this task?

Anindya Chatterjee
--------------------------------------------------------
1. Don't Visit ..[^]

2. But Watch ..

modified on Friday, May 22, 2009 12:32 AM

Questiondatagrid reorder Pin
michaelgr121-May-09 10:19
michaelgr121-May-09 10:19 
AnswerRe: datagrid reorder Pin
Luc Pattyn21-May-09 10:30
sitebuilderLuc Pattyn21-May-09 10:30 
AnswerRe: datagrid reorder Pin
michaelgr121-May-09 19:40
michaelgr121-May-09 19:40 
GeneralRe: datagrid reorder Pin
Luc Pattyn22-May-09 2:05
sitebuilderLuc Pattyn22-May-09 2:05 
QuestionHttpWebRequest and something to do with security level... Pin
SimpleData21-May-09 9:21
SimpleData21-May-09 9:21 
AnswerRe: HttpWebRequest and something to do with security level... Pin
Manas Bhardwaj21-May-09 11:12
professionalManas Bhardwaj21-May-09 11:12 
GeneralRe: HttpWebRequest and something to do with security level... Pin
SimpleData22-May-09 3:20
SimpleData22-May-09 3:20 
Questionhow to ceate event_click for button with C# ? [modified] Pin
xingselex21-May-09 9:18
xingselex21-May-09 9:18 
AnswerRe: how to ceate event_click for button with C# ? Pin
Luc Pattyn21-May-09 10:15
sitebuilderLuc Pattyn21-May-09 10:15 
AnswerRe: how to ceate event_click for button with C# ? Pin
_Maxxx_21-May-09 17:35
professional_Maxxx_21-May-09 17:35 
Questionhow create a Function return as DataTable with C# ? Pin
xingselex21-May-09 8:22
xingselex21-May-09 8:22 
AnswerRe: how create a Function return as DataTable with C# ? Pin
0x3c021-May-09 8:26
0x3c021-May-09 8:26 
AnswerRe: how create a Function return as DataTable with C# ? Pin
MidwestLimey21-May-09 8:50
professionalMidwestLimey21-May-09 8:50 
AnswerRe: how create a Function return as DataTable with C# ? Pin
cod3newbie22-May-09 7:19
cod3newbie22-May-09 7:19 
QuestionAutomatic webbrowsing gives "object reference not set to an instance of an object" Pin
Member 441789221-May-09 8:17
Member 441789221-May-09 8:17 
AnswerRe: Automatic webbrowsing gives "object reference not set to an instance of an object" Pin
0x3c021-May-09 8:21
0x3c021-May-09 8:21 
AnswerRe: Automatic webbrowsing gives "object reference not set to an instance of an object" Pin
Luc Pattyn21-May-09 8:22
sitebuilderLuc Pattyn21-May-09 8:22 

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.