explicit-interface

Why does the VS Metadata view does not display explicit interface implemented members

孤人 提交于 2019-11-27 07:54:35
问题 The other day i was looking at C# Boolean struct metadata. Boolean implements the interface IConvertible. But looking at Boolean's members i could not see most of the IConvertible members. I've done some tests with some colleagues, including creating our own classes, and came to the conclusion that IConvertible must be implemented explicitly for Boolean. The question is, why are they not visible? I understand it might be a 'by design decision' but i understand that it would add greater value

Access modifiers on interface members in C#

限于喜欢 提交于 2019-11-27 02:44:20
问题 I am getting a compile error from the following property. The error is: "The modifier 'public' is not valid for this item" public System.Collections.Specialized.StringDictionary IWorkItemControl.Properties { get { return properties; } set { properties = value; } } but if I remove the IWorkItemControl it compiles fine. Why am I getting this error and what is the difference of having / not having the interface name in the signature? 回答1: Explicit interface implementation does not let you