How to Override a private set property

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-16T06:32:57Z Indexed on 2010/04/16 9:03 UTC
Read the original article Hit count: 262

Filed under:

Hi, Im using the Microsoft.Office.Interop.MSProject.Resource assembly which has a "UniqueID" property, it has a get but not set. How can I actually set a value?

An example would be very much appreciated. --Update--

Ok I can get the value for a property "Name" and set, but Im intersted in the "UniqueId" property that does not have a public set (get only):

int ii = (int)resource.GetType().InvokeMember("UniqueID", BindingFlags.GetProperty, null, resource, new object[] { });
resource.GetType().InvokeMember("UniqueID", BindingFlags.SetProperty, null, resource, new object[] {iUid,});

I get the following error {"Number of parameters specified does not match the expected number."}

anyway for me to work out how many paramters it needs?

© Stack Overflow or respective owner

Related posts about vsto