0

以下のコードで次のエラーが発生します。

期待されるクラス、デリゲート、列挙型、インターフェイス、または構造体。

これは、GH_ObjectResponseにカーソルを合わせると発生しますが、何が間違っていますか?

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;
}
4

2 に答える 2

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;
    }
}
于 2012-08-02T01:34:33.970 に答える
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;
    }
}
于 2012-08-02T01:35:20.647 に答える