Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 错误:应为类、委托、枚举、接口或结构_C#_Visual Studio 2010_Syntax Error - Fatal编程技术网

C# 错误:应为类、委托、枚举、接口或结构

C# 错误:应为类、委托、枚举、接口或结构,c#,visual-studio-2010,syntax-error,C#,Visual Studio 2010,Syntax Error,我在下面的代码中遇到以下错误: 应为类、委托、枚举、接口或结构 当将鼠标悬停在GH_ObjectResponse上时会发生这种情况,我做错了什么 public class SettingsComponentAttributes : GH_ComponentAttributes { public SettingsComponentAttributes(IGH_Component SettingsComponent) : base(SettingsComponent) {

我在下面的代码中遇到以下错误:

应为类、委托、枚举、接口或结构

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

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

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

小心你的支架。应该是:

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