2012-08-09 3 views
3

정보를 뷰에서 발표자로 전달하는 이벤트 구조를 구현 중입니다. 버튼을 클릭하면 뷰에서 다음 코드를 호출 : 어떤 이유대리자를 호출 할 때 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. 
    } 

답변

1

나는 덕분에 실수를 저지르고있었습니다. "Build Solution"도구를 사용했지만 Build Configuration Manager에서 Visual Studio 2010 (빌드 -> 구성 관리자)을 보지 않았습니다. (예 : QAz.Presenter 및 QAz.View으로 내가 편집 한 프로젝트에 해당하는) 그 빌드 열 체크 마크 중 일부는 선택되지 않은

Screenshot of configuration manager in VS2010

, 전에, 그래서 "이,이 발견 Build Solution "이 건너 뜁니다. 이러한 프로젝트를 선택한 후에 Visual Studio는 솔루션을 실행했을 때이를 빌드 할 수 있다는 것을 알고있었습니다.

5

90 % 당신이 보면 당신이 찾을 수 있습니다.

private void AlterCompound1_Action(object, EventArgs e) 
{ 
    throw new NotImplementedException(); 
} 
+0

불행히도, 아니요. 내 인생이 쉬워 졌을거야. –

+0

@QtotheC : MainPresenter 클래스를 삭제하고, 재 컴파일하고, 예외가 발생했다면 어떻게 될까? 시도 해봐. – Will

+0

네, 맞습니다. 나는 다른 곳에서 수업을 듣지 않는다고 불평 할 것이라고 생각했다. 그것의 원인은 무엇입니까? 내 코드 파일이 다른 클래스로 분할되는 것과 관련이 있습니까? 나는 VS 2010에서 일하고 있으며 솔루션을 다시 빌드하라고 말하고 있습니다. –

관련 문제