dimanche 22 janvier 2017

populate List

Forgive me for just grasping these terms, I'm on the edge of my C# knowledge here and need to ask for guidance.

I have a DLL which includes two classes and a form (additional class) one of the classes workitems has public (string name, int id).

// in the DLL:
public class workitems {
     public string name {get;set;};
     public int id{get;set;};
}

The workhorse class has a variable used in several functions

// in the DLL:
public class workhorse {
    List<workitems> WorkLoad = new List<workitems>();

    public function DoThings() {   ..... stuff ...... }
}

In another program, I need to call this dll (I assume via reflection). I've tried

 // in a separate C# script that needs to call this via reflection
 Assembly asm = Assembly.LoadFile(thedll);

but I can't figure out how to load workitems into the variable, and then call a function from the dll with those workitems... I'm getting confused with type/class/methodinfo/.GetType... any guidance would be appreciated.

From the program that has to call the dll file I need do something like :

otherdll.workload.add( stuff )

otherdll.DoThings(); (which uses the workload from that class)





Aucun commentaire:

Enregistrer un commentaire