1 接口 桥接模式
可以扩展添加原有dll的方法(解释了在xcap项目中为什么IMainViewer mainViewer = this.ctlMainMapViewer; (this.mainViewer as IViewer).MouseMode = NavigationMode.Zoom; 而不直接 this.ctlMainMapViewer.MouseMode = NavigationMode.Zoom的原因,因为这个MouseMode是我们的新接口中新加的)
2 一个接口的描述形式
// Summary:
// System.EventArgs is the base class for classes containing event data.
[Serializable]
[ComVisible(true)]
public class EventArgs
{
// Summary:
// Represents an event with no event data.
public static readonly EventArgs Empty; // 可以理解为public static readonly EventArgs Empty = null; 当外部使用时 EventArgs aaa = EventArgs.Empty 即表示EventArgs aaa = null;
// Summary:
// Initializes a new instance of the System.EventArgs class.
public EventArgs();
}
浙公网安备 33010602011771号