Pavel

Pavel

  • 1.6k
  • 170
  • 51.3k

Parameter List by value ???

Sep 24 2012 6:02 AM
Hello,

I need to pass List lst1 by value into ProgressChanged handler. This handler has second parameter of type ProgressChangedEventArgs. ProgressChangedEventArgs structure has 2 members: int and object. Object-type member can be customized. Using it I pass some custom structure, that is "casted" inside of handler.

struct AAA
{
        int cnt;
        List<SomeType1> lst;
}

The problem is, once inside of handler the member lst from AAA is still connected to the source_list in the calling function (that is background process). There, the source_list is changing, so does its "homologue" inside of handler ...

Regards.

Pavel.