
Huwaw!
fromhttp://www.codeproject.com/KB/mcpp/CppCliProperties.aspx?msg=1361608Indexed properties
Indexed properties allow array like access on an object and there's also support for a default indexed property - essentially a nameless property which lets you directly use
[]
on the object. Below example features both named and default index properties. I believe C#ers call indexed properties as indexors so perhaps you might see these two words used interchangeably.ref class R { private: Hashtable^ h; public: R() { h = gcnew Hashtable(); } //Named property property int Age[String^] { protected: int get(String^ s) { if(h->ContainsKey(s)) { for each(DictionaryEntry de in h) { if(s->CompareTo(de.Key) == 0) return (int)de.Value; } } return 0; } void set(String^ s, int age) { h->Add(s,age); } } //Default property property int default[String^] { int get(String^ s) { return Age[s]; } void set(String^ s, int age) { Age[s] = age; } } };
R SomeClass = gcnew R();int RightHandTerm = 10;String ^LeftHandTerm = "No Name";
SomeClass->Age[LeftHandTerm] = RightHandTerm; //assignment to property Age, //Set() method will be called
void set(String^ s, int age)
« on: August 04, 2008, 07:40:48 PM »Quote
If you think your ISP is either throttling, rate shaping, or blocking your P2P or bittorrent usage, you might want to test your ISP. The Electronic Freedom Foundation (EFF) has a relatively new tool out named "Switzerland" to test if your ISP is content neutral or if it is obeying the RIAA/MPAA/bigbusiness. I guess the tool is named after Switzerland for "content neutrality".
Switzerland P2P verification tool:
http://www.eff.org/testyourisp/switzerland