本文介绍了实施接口时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public interface ICaseStageTransitionControlView : IControlView
{
Button PassButtonToControl { get;set;}
}

namespace Prateep.MSC.Web.Mod.CSE
{
public partial class CaseStageTransitionControl : ICaseStageTransitionControlView
{
 public Button PassButtonToControl
        {
            get { return _button; }
            set { _button = value; }
        }
}





Error	4 'Prateep.MSC.Web.Mod.CSE.CaseStageTransitionControl' does not implement interface member 'Prateep.MSC.Web.Mod.CSE.Views.ICaseStageTransitionControlView.PassButtonToControl 'Prateep.MSC.Web.Mod.CSE.Case.CaseStageTransitionControl.PassButtonToControl' is either static, not public, or has the wrong return type.



我检查了3次,但不知道有什么问题,抱怨有任何帮助.



I checked 3 times i have no clue whats its complaining any help would be appreciated .

推荐答案

interface ICaseStageTransitionControlView: IControlView
{
    Button PassButtonToControl { get; set;}
}

public partial class CaseStageTransitionControl : ICaseStageTransitionControlView
{
    public Button PassButtonToControl { get; set; }
}

讨论:这假定您已经正确地实现了IControlView接口所需的一切.

Discussion: This assumes that you''ve done the right thing to implement whatever the IControlView interface requires.


public interface ICaseStageTransitionControlView : IControlView
{
    Button PassButtonToControl { get; set;}
}

public partial class CaseStageTransitionControl : ICaseStageTransitionControlView
{
    Button ICaseStageTransitionControlView.PassButtonToControl { get; set; }
}



有关更多详细信息,请参见:
http://msdn.microsoft.com/en-us/library/aa288461%28v = vs.71%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/ms173157.aspx [ ^ ].


另请参见:
http://blogs.msdn.com/b/mhop/archive/2006/12/12/implicit-and-explicit-interface-implementations.aspx [ ^ ],
http://adilakhter.wordpress.com/2007/05/02 /explicit-interface-implementation-using-c-interface101/ [ ^ ].

—SA



For further detail, please see:
http://msdn.microsoft.com/en-us/library/aa288461%28v=vs.71%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms173157.aspx[^].


See also:
http://blogs.msdn.com/b/mhop/archive/2006/12/12/implicit-and-explicit-interface-implementations.aspx[^],
http://adilakhter.wordpress.com/2007/05/02/explicit-interface-implementation-using-c-interface101/[^].

—SA



这篇关于实施接口时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 20:23