Hello,
I have a singletone class and 2 diffeerent properties there,I want to
aggrigate them together in a class .How can I do it? (code)
Thank you!
*** Sent via Developersdex http://www.developersdex.com ***
If I understood you correctly, one solution could be:
//the "aggregate class":
class TheSettings
{
private int _number;
private string _text;
public TheSettings(int Number, string Text)
{
_number = Number; _text = Text;
}
// skipped the properties for Number and Text
}
// the singleton
class TheSingleton
{
private int _aNumber;
private string _aText;
// skipped singleton code
public TheSettings AggregateSettings
{
get { return new TheSettings(_aNumber, _aText); }
set { _aNumber = value.Number; _aText = value.Text; }
}
}
Hans Kesting