I’m trying to write this more generically:
public static CormantRadDock RecreateDock(RadDockSetting settings)
{
CormantRadDock dock = new CormantRadDock();
settings.SetSettings(dock);
Logger.DebugFormat("Recreated dock {0}", dock.ID);
return dock;
}
I have this:
public static T Recreate<T>() where T : new()
{
T _control = new T();
//settings.SetSettings(dock);
Logger.DebugFormat("Recreated control {0}", (_control as Control).ID);
return _control;
}
Generic Solution:
public interface ISetting<T>
{
void SetSettings(T obj);
}
public void SetSettings(CormantRadDock dock)
{
// do stuff with dock
}
Thanks!
Is this what you’re trying to do?
Then you can implement it successfully in a class: