I want to write a generic singleton with an external constructor. In other words the constructor can be modified. I have 2 designs in my mind but I don't know whether they are practical or not.
First one is to enforce derived class' constructor to be non-public but I do not know if there is a way of it?
Second one is to use a delegate and call it inside the constructor?
It isn't necessarily to be a constructor. The reason I chose custom constructor is doing some custom initializations.
Any suggestions would be appreciated :)
I wrote a plugin system and I want to save/load their properties so that if the program is restarted they can continue working. I use binary serialization. The problem is they can be serialized but not deserialized.
During the deserialization "Unable to find assembly" exception is thrown. How can I restore serialized data?
Hi,
Every time when I change some values in form controls, I need to set a property of an object or vice versa. Instead of writing some methods for each control, I want a general solution for GUI elements. I do not use WPF but only C# 3.0.
Any suggestions?
Thanks.
I want to access the properties of a class from the attribute class by using reflection. Is it possible?
For example:
class MyAttribute : Attribute
{
private void AccessTargetClass()
{
// Do some operations
}
}
[MyAttribute]
class TargetClass
{
}