gpt4 book ai didi

c# - 错误: expected class,delegate,enum,interface or struct

转载 作者:行者123 更新时间:2023-12-03 08:13:49 25 4
gpt4 key购买 nike

我在以下代码上收到以下错误:

expected class,delegate,enum,interface or struct.



将鼠标悬停在 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;
}

最佳答案

您的方法未在类内声明……请尝试以下方法:

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

关于c# - 错误: expected class,delegate,enum,interface or struct,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11769866/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com