Questions tagged «static-indexers»

7
静态索引器?
Наэтотвопросестьответына 堆栈溢出нарусском:Перегрузкаиндексаторастатическогокласса 为什么在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> /// <param name="name">Name of the property</param> /// …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.