, () ( ) - , , .
:
public interface IDoSomethingFantastic
{
}
, , :
public partial class ArticlePage : System.Web.UI.Page, IDoSomethingFantastic
{
}
public partial class ArticleListPage : System.Web.UI.Page, IDoSomethingFantastic
{
}
:
if (this.Page is IDoSomethingFantastic)
{
}
"" ; , / "" .
, "" /:
public interface IDoSomethingFantastic
{
void SomethingFantastic();
}
:
if (this.Page is IDoSomethingFantastic)
{
((IDoSomethingFantastic)this.Page).SomethingFantastic();
}
, - . :
if (FantasticHandler.IsPageFantastic(this.Page))
FantasticHandler.DoSomethingFantastic(this.Page);