1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
public: Object^ obj;
private: int test;
private: static Hashtable^ tabobj=gcnew Hashtable();
public: property Object^ item[String^]
{
Object^ get(String^ str)
{
if(tabobj->ContainsKey(str)==true)
{
MessageBox::Show("Recuperation dans la table");
obj=tabobj[str];
}
else MessageBox::Show("La cle n existe pas");
return obj;
}
void set(String^ str,Object^ value)
{
if(tabobj->ContainsKey(str)==false)
{
MessageBox::Show("Creation de la valeur cle");
obj=value;
tabobj->Add(str,obj);
}
}
} |