Trying to read a property value (from a loaded Assembly/Plugin)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xsd
    New Member
    • Apr 2008
    • 2

    Trying to read a property value (from a loaded Assembly/Plugin)

    Hello 2 all,

    I have the following problem in finding the property value from the loaded assembly (control).

    I am the following setup:

    Language: C#
    OS: WinXP
    MVS 2005/2008
    .NET 2.0 - 3.5

    Written a base class called "baseOne" (on a separate Assembly), inside this I have a string property "myValue" (with get & set)

    Written another class called "formOne" (on a separate Assembly) by referring to the "baseOne" class. On this formOne, have placed a listbox and on click of an item on the listbox, am trying to assign the selected value into the Property "myValue"

    So far no issues.

    On the main application, along with code for the form creation, have code to handle the form "Clicked" method.

    Inside this click method, I have the following code:

    Type senderType = sender.GetType( );
    PropertyInfo idInfo = senderType.GetP roperty("myValu e");
    string id = String.Empty;
    if (idInfo != null)
    id = idInfo.GetValue (sender, null).ToString( );

    -- issue --
    MessageBox.Show (id); //resulting blank

    I tried to debug through the code, the property "myValue" value been retrieved from "baseOne" and not from the "formOne"!

    Anyone? Would appreciate help on the issue...

    *Hope it is not confusing, if so, would re-do the post
  • xsd
    New Member
    • Apr 2008
    • 2

    #2
    I have found out the problem/issue, myself.

    My bad, I had two assembly files in two locations and all along, it was referred to the bad location. Once I have found the duplicate issue, and ran the main app. the result was flowing smoothly. - no issues.

    Thanks for looking in.
    (this is one of the good place for giving and taking answers)

    Comment

    Working...