Click here to Skip to main content
15,913,453 members
Home / Discussions / C#
   

C#

 
AnswerRe: TabPage (Or - What's Wrong With that Control??) Pin
Tamimi - Code6-Nov-07 3:46
Tamimi - Code6-Nov-07 3:46 
GeneralRe: TabPage (Or - What's Wrong With that Control??) Pin
half-life6-Nov-07 5:23
half-life6-Nov-07 5:23 
AnswerRe: TabPage (Or - What's Wrong With that Control??) Pin
snorkie6-Nov-07 4:59
professionalsnorkie6-Nov-07 4:59 
GeneralRe: TabPage (Or - What's Wrong With that Control??) Pin
half-life6-Nov-07 5:19
half-life6-Nov-07 5:19 
QuestionFile Creation Time Pin
telha6-Nov-07 1:02
telha6-Nov-07 1:02 
AnswerRe: File Creation Time Pin
Anthony Mushrow6-Nov-07 1:17
professionalAnthony Mushrow6-Nov-07 1:17 
AnswerRe: File Creation Time Pin
Rob Philpott6-Nov-07 1:18
Rob Philpott6-Nov-07 1:18 
QuestionTextBox validating e.cancel=true does not cancel button event Pin
fracalifa6-Nov-07 0:48
fracalifa6-Nov-07 0:48 
AnswerRe: TextBox validating e.cancel=true does not cancel button event Pin
telha6-Nov-07 1:07
telha6-Nov-07 1:07 
AnswerRe: TextBox validating e.cancel=true does not cancel button event Pin
Nagy Vilmos6-Nov-07 1:25
professionalNagy Vilmos6-Nov-07 1:25 
GeneralRe: TextBox validating e.cancel=true does not cancel button event Pin
fracalifa6-Nov-07 3:00
fracalifa6-Nov-07 3:00 
GeneralRe: TextBox validating e.cancel=true does not cancel button event Pin
Nagy Vilmos6-Nov-07 4:24
professionalNagy Vilmos6-Nov-07 4:24 
QuestionDelegate for a field function Pin
manustone6-Nov-07 0:45
manustone6-Nov-07 0:45 
AnswerRe: Delegate for a field function Pin
TJoe6-Nov-07 1:42
TJoe6-Nov-07 1:42 
Before I get to your real question, we need to make sure we are on the same page. In your code example above, MyField is a property, not a field. Below is an example of a field and a property:

private String myField = String.Empty;
 
// Properties have get/set accessors...
public String MyProperty {
    get {
        return this.myField;
    }
}


Now, for your question. There is no direct way to create a delegate to a property's get or set accessors. It is possible, as shown here[^], but it's somewhat of a hack. I call it a hack, because you need to pass the name of the property to get the delegate. So if you change the name of the property, then your delegate will be broken.

You may be able to use anonymous methods[^] (see Figure 10) to accomplish what you want.



Take care,
Tom

-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com

GeneralRe: Delegate for a field function Pin
manustone6-Nov-07 2:23
manustone6-Nov-07 2:23 
AnswerRe: Delegate for a field function Pin
MarkusStr6-Nov-07 1:46
MarkusStr6-Nov-07 1:46 
GeneralRe: Delegate for a field function Pin
manustone6-Nov-07 2:24
manustone6-Nov-07 2:24 
Questiontemporary file in C# Pin
kaminem6-Nov-07 0:45
kaminem6-Nov-07 0:45 
AnswerRe: temporary file in C# Pin
Vasudevan Deepak Kumar6-Nov-07 0:47
Vasudevan Deepak Kumar6-Nov-07 0:47 
AnswerRe: temporary file in C# Pin
Pete O'Hanlon6-Nov-07 2:56
mvePete O'Hanlon6-Nov-07 2:56 
AnswerRe: temporary file in C# Pin
Le centriste6-Nov-07 3:53
Le centriste6-Nov-07 3:53 
QuestionCan any one please help me how to implement paging with datalist in C#,ASP.Net Pin
clife5375-Nov-07 23:28
clife5375-Nov-07 23:28 
AnswerRe: Can any one please help me how to implement paging with datalist in C#,ASP.Net Pin
Sun Rays5-Nov-07 23:45
Sun Rays5-Nov-07 23:45 
GeneralRe: Can any one please help me how to implement paging with datalist in C#,ASP.Net Pin
clife5375-Nov-07 23:47
clife5375-Nov-07 23:47 
GeneralRe: Can any one please help me how to implement paging with datalist in C#,ASP.Net Pin
Christian Graus5-Nov-07 23:50
protectorChristian Graus5-Nov-07 23:50 

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.