คำถามติดแท็ก static-indexers

7
ดัชนีคงที่?
Наэтотвопросестьответына Stack Overflow нарусском : Перегрузкаиндексаторастатическогокласса ทำไมตัวทำดัชนีคงที่ไม่ได้รับอนุญาตใน C # ฉันไม่เห็นเหตุผลว่าทำไมจึงไม่ควรอนุญาตและยิ่งไปกว่านั้นมันอาจมีประโยชน์มาก ตัวอย่างเช่น: public static class ConfigurationManager { public object this[string name] { get => ConfigurationManager.getProperty(name); set => ConfigurationManager.editProperty(name, value); } /// <summary> /// This will write the value to the property. Will overwrite if the property is already there /// </summary> …
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.