覆盖内部方法 [英] Overwrite an internal method

查看:74
本文介绍了覆盖内部方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何覆盖

How can i "overwrite"

internal void PrepareHeaders(bool sendEnvelope) { }



方法


method in

internal class Message { }







我想关闭自动覆盖Date标头,它就在这个方法中。


?

I would like to turn off the automatic overwrite of the Date header, and it is in this method.

推荐答案

你好b $ b

你只能覆盖抽象或者虚拟方法。

如果你可以覆盖PrepareHeaders方法,你必须将PrepareHeaders定义为抽象或虚拟方法。



我希望它对你有帮助你。
Hi
You can only override Abstract or Virtual method.
If you can override PrepareHeaders method, you must define PrepareHeaders as abstract or virtual method.

I hope it's helpful for you.


继续解决方案1,因为你使用我怎么能......



你需要做一些关于多态(和继承)的研究



这是一个 MSDN的起点 [ ^ ]
Further to solution 1 and because you use the words "How can I" ...

You need to do a little research around polymorphism (and inheritance)

Here's a start point at MSDN[^]


这篇关于覆盖内部方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆