0

I tried to code my own serialization dll. The code itself works as expected. Now I want to put the entire code into a dll file.

My problem is the following: how do I tell the dll WHICH class it should serialize?

Example:

public class serialize
{
    public static void doSerialization(class serializableClass, string path, string fileName)
    {
        do code here...
    }
}

Ok. I used class serializableClass, you know? Type + Name. Sure It won't work like this. I was afraid it wouldn't. But how do I do it, though? I want the dll to serialize the class settings.cs which is in my main program... I hope the question is clear. Otherwise just ask ;)

Thanks for Your help. Best Regards.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

You need to pass object of class not class it self. Assuming serializableClass is a class. Although the library (dll) does not know your class serializableClass. You can make library of common classes and add reference of that library in main program and library for serialization.

public class serialize
{
    public static void doSerialization(serializableClass objSerializableClass , string path, string fileName)
    {
        do code here...
    }
}
Adil
  • 146,340
  • 25
  • 209
  • 204