Click here to Skip to main content
15,896,269 members
Home / Discussions / C#
   

C#

 
GeneralRe: Use a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
olibara14-Dec-10 6:28
olibara14-Dec-10 6:28 
GeneralRe: Use a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
Henry Minute14-Dec-10 7:10
Henry Minute14-Dec-10 7:10 
GeneralRe: Use a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
Henry Minute14-Dec-10 7:58
Henry Minute14-Dec-10 7:58 
GeneralRe: Use a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
olibara14-Dec-10 23:30
olibara14-Dec-10 23:30 
QuestionEvent for checking if a delegate/anonymous method result changed Pin
hoernchenmeister14-Dec-10 3:40
hoernchenmeister14-Dec-10 3:40 
AnswerRe: Event for checking if a delegate/anonymous method result changed Pin
Abhinav S14-Dec-10 5:14
Abhinav S14-Dec-10 5:14 
GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
hoernchenmeister14-Dec-10 5:45
hoernchenmeister14-Dec-10 5:45 
AnswerRe: Event for checking if a delegate/anonymous method result changed Pin
Ian Shlasko14-Dec-10 5:25
Ian Shlasko14-Dec-10 5:25 
Well, the result changes when one or more of the inputs change, so what you really need to watch for is a change to the inputs. If this is on an object that implements change notification, you could pass that through and only check for a new result if the object reports a change.

But as for a changed event on the function itself... To my knowledge, no such thing exists. That function isn't going to re-run every time the inputs change, so the program doesn't even know what the new result is until you ask for it.

Off the top of my head, another alternative...

Instead of passing a function, wrap that up in a lightweight class:
public class FunctionWatcher
{
  public FunctionWatcher(INotifyPropertyChanged caller, Delegate function)
  {
    // ...
  }

  private Delegate Callback;
  public object Result { get; private set; }
  public event EventHandler ResultChanged;

  private void CallerPropertyChanged(...)
  {
    // invoke the callback, update Result, call ResultChanged if appropriate
  }
}

Again, this relies on having some object providing change notification... Otherwise your current solution might be the only one.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
hoernchenmeister14-Dec-10 5:43
hoernchenmeister14-Dec-10 5:43 
GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
Ian Shlasko14-Dec-10 6:07
Ian Shlasko14-Dec-10 6:07 
GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
hoernchenmeister14-Dec-10 6:33
hoernchenmeister14-Dec-10 6:33 
GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
Ian Shlasko14-Dec-10 7:30
Ian Shlasko14-Dec-10 7:30 
GeneralRe: Event for checking if a delegate/anonymous method result changed Pin
hoernchenmeister14-Dec-10 20:38
hoernchenmeister14-Dec-10 20:38 
QuestionDynamic Polymorphism Pin
Baji Jabbar13-Dec-10 23:31
Baji Jabbar13-Dec-10 23:31 
AnswerRe: Dynamic Polymorphism Pin
Hiren solanki13-Dec-10 23:48
Hiren solanki13-Dec-10 23:48 
AnswerRe: Dynamic Polymorphism Pin
Richard MacCutchan13-Dec-10 23:49
mveRichard MacCutchan13-Dec-10 23:49 
GeneralRe: Dynamic Polymorphism Pin
Hiren solanki13-Dec-10 23:57
Hiren solanki13-Dec-10 23:57 
GeneralRe: Dynamic Polymorphism Pin
Baji Jabbar14-Dec-10 0:00
Baji Jabbar14-Dec-10 0:00 
GeneralRe: Dynamic Polymorphism Pin
Pete O'Hanlon14-Dec-10 0:43
mvePete O'Hanlon14-Dec-10 0:43 
GeneralRe: Dynamic Polymorphism Pin
Richard MacCutchan14-Dec-10 1:02
mveRichard MacCutchan14-Dec-10 1:02 
Questionadding new data over ProcessLayer Pin
Erdinc2713-Dec-10 22:12
Erdinc2713-Dec-10 22:12 
AnswerRe: adding new data over ProcessLayer Pin
Hiren solanki13-Dec-10 23:17
Hiren solanki13-Dec-10 23:17 
GeneralRe: adding new data over ProcessLayer Pin
Erdinc2713-Dec-10 23:46
Erdinc2713-Dec-10 23:46 
AnswerRe: adding new data over ProcessLayer Pin
Hiren solanki13-Dec-10 23:55
Hiren solanki13-Dec-10 23:55 
GeneralRe: adding new data over ProcessLayer Pin
Erdinc2714-Dec-10 0:15
Erdinc2714-Dec-10 0:15 

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.