I would like to have a C# collection of string constants, which must have:
1.Keys (defined due compiled time), which i could access like:
Console.WriteLine(obj.Key1); // string output: Value1
Console.WriteLine(obj.Key2); // string output: Value2
The purpose is to have Intellisens support (obj.\ctrl+space\ - keys list appears)
2.Enumeration:
foreach(var key in obj)
{
Console.WriteLine(key);
// output:
// Value1
// Value2
}
3.Inheritance
class A {
obj.A = "Value1";
obj.B = "Value2";
public void IterateOverMyObj()
{
foreach (var obj in MyObj)
{
Console.WriteLine(obj);
// Output:
// Value1
// Value2
}
}
class B : A {
obj.A = "Value1New";
obj.C = "Value3NewKey";
}
void Main()
{
B b = new B();
b.IterateOverMyObj();
// output:
// Value1New
// Value2
// Value3NewKey
}
As values i need strings only. Is it all possible?