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

C#

 
AnswerRe: XML Serialization of ArrayList? Pin
Henry Minute14-Dec-10 11:40
Henry Minute14-Dec-10 11:40 
GeneralRe: XML Serialization of ArrayList? [modified] Pin
Software200714-Dec-10 13:56
Software200714-Dec-10 13:56 
AnswerRe: XML Serialization of ArrayList? Pin
Hiren solanki14-Dec-10 19:45
Hiren solanki14-Dec-10 19:45 
GeneralRe: XML Serialization of ArrayList? Pin
Software200715-Dec-10 2:52
Software200715-Dec-10 2:52 
AnswerRe: XML Serialization of ArrayList? Pin
Hiren solanki15-Dec-10 2:58
Hiren solanki15-Dec-10 2:58 
GeneralRe: XML Serialization of ArrayList? Pin
Henry Minute15-Dec-10 2:26
Henry Minute15-Dec-10 2:26 
GeneralRe: XML Serialization of ArrayList? [modified] Pin
Software200715-Dec-10 2:55
Software200715-Dec-10 2:55 
GeneralMessage Removed Pin
15-Dec-10 3:20
Software200715-Dec-10 3:20 
GeneralRe: XML Serialization of ArrayList? Pin
Henry Minute15-Dec-10 3:29
Henry Minute15-Dec-10 3:29 
GeneralRe: XML Serialization of ArrayList? Pin
Software200715-Dec-10 3:46
Software200715-Dec-10 3:46 
GeneralRe: XML Serialization of ArrayList? Pin
Henry Minute15-Dec-10 3:52
Henry Minute15-Dec-10 3:52 
GeneralRe: XML Serialization of ArrayList? Pin
Software200715-Dec-10 3:58
Software200715-Dec-10 3:58 
QuestionUse a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
olibara14-Dec-10 4:04
olibara14-Dec-10 4:04 
AnswerRe: Use a ComboBoxCell to update textboxcell on a Binded Datagridview Pin
Henry Minute14-Dec-10 5:40
Henry Minute14-Dec-10 5:40 
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 

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.