I have my own class named MyClass, how do I store objects of that type to Registry using your classes?
The first step is making your class serializable, which is very easy. Simply add the string “[Serializable]” on top of your class definition, like so:
using System.Something;
namespace SomeNamespace
{
[Serializable]
public class MyClass
{
...
}
}
Next step is to create an instance of the CoreRegistry class
CoreRegistry reg = new CoreRegistry("MyProgram", "MyCompany");
And with this reg object you get and set objects of type MyClass in Registry:
MyClass mycls = new MyClass();
reg.SetObject("NameOfKey", mycls);
mycls = null;
mycls = (MyClass)reg.GetObject("NameOfKey");
