2012-08-02 5 views
0

내가 얻을 아래의 코드에 다음과 같은 오류 : 내가 무슨 잘못을하고있는 중이 야오류 : 예상 클래스, 위임, 열거, 인터페이스 또는 구조체

GH_ObjectResponse에 유혹 할 때 발생

expected class,delegate,enum,interface or struct.

? 귀하의 방법은 클래스 내에서 선언되지

public class SettingsComponentAttributes : GH_ComponentAttributes 
{ 
    public SettingsComponentAttributes(IGH_Component SettingsComponent) : 
     base(SettingsComponent) {} 
} 

public override GH_ObjectResponse RespondToMouseDoubleClick(
    GH_Canvas sender, GH_CanvasMouseEvent e) 
{ 
    ((SettingsComponent)Owner).ShowSettingsGui(); 
    return GH_ObjectResponse.Handled; 
} 

답변

5

... 대신이 시도 :

public class SettingsComponentAttributes : GH_ComponentAttributes 
{ 
    public SettingsComponentAttributes(IGH_Component SettingsComponent) : base(SettingsComponent) { } 

    public override GH_ObjectResponse RespondToMouseDoubleClick(GH_Canvas sender, GH_CanvasMouseEvent e) 
    { 
     ((SettingsComponent)Owner).ShowSettingsGui(); 
     return GH_ObjectResponse.Handled; 
    } 
} 
1

이 브래킷을보세요. 다음과 같아야합니다.

public class SettingsComponentAttributes : GH_ComponentAttributes 
{ 
    public SettingsComponentAttributes(IGH_Component SettingsComponent) : base(SettingsComponent) {} 

    public override GH_ObjectResponse RespondToMouseDoubleClick(GH_Canvas sender, GH_CanvasMouseEvent e) 
    { 
     ((SettingsComponent)Owner).ShowSettingsGui(); 
     return GH_ObjectResponse.Handled; 
    } 
} 
관련 문제