정보를 뷰에서 발표자로 전달하는 이벤트 구조를 구현 중입니다. 버튼을 클릭하면 뷰에서 다음 코드를 호출 : 어떤 이유대리자를 호출 할 때 NotImplementedException
private void alterCmpd1()
{
EventHandler AlterEvent = AlterCompound1_Action;
if (AlterEvent != null) AlterEvent(this, EventArgs.Empty);
}
public event EventHandler AlterCompound1_Action;
하는 NotImplementedException은 항상 나타납니다
AlertEvent(this, EventArgs.Empty);
누군가 나를 알아 왜 도와 주 시겠어요? 발표자 클래스
코드 :
public MainPresenter(IMainView view, IModel model)
{
this.view = view;
this.view.AlterCompound1_Action += new EventHandler(view_AlterCompound1);
this.model = model;
view.Show();
}
void view_AlterCompound1(object sender, EventArgs e)
{
// I commented out this code, on the off
// chance that it was affecting things. Still no luck.
}
불행히도, 아니요. 내 인생이 쉬워 졌을거야. –
@QtotheC : MainPresenter 클래스를 삭제하고, 재 컴파일하고, 예외가 발생했다면 어떻게 될까? 시도 해봐. – Will
네, 맞습니다. 나는 다른 곳에서 수업을 듣지 않는다고 불평 할 것이라고 생각했다. 그것의 원인은 무엇입니까? 내 코드 파일이 다른 클래스로 분할되는 것과 관련이 있습니까? 나는 VS 2010에서 일하고 있으며 솔루션을 다시 빌드하라고 말하고 있습니다. –